Tuesday, July 28, 2020

Solving your first problem in C++ on CodeChef

Problem Name : Life, the Universe, and Everything How to solve this question? In this question they telling us to take the input of a number and display that number, repeat this proedure till we encounter number 42. After that we need to stop. Solution : #include <iostream> using namespace...

Sunday, July 26, 2020

Introduction to Programming in C week 0 assignment(jul-dec 2020)

Hello everyone! solution of Introduction to Programming in C week 0 assignment are given below. Question 1 :  #include<stdio.h> int main() {   printf("Hello C");   return 0; } Question 2 : #include<stdio.h> int main() {   int a,b;   scanf("%d%d",&a,&b);   int avg = (a+b)/2;   printf("%d",avg);   return 0; } ...

Tuesday, April 7, 2020

PROGRAMMING IN JAVA WEEK 10

QUESTION 1: import java.*; import java.sql.*; QUESTION 2: // Open a connection and check connection status conn = DriverManager.getConnection(DB_URL); if(conn.isClosed())   System.out.print("false"); else   System.out.print("true"); QUESTION 3: import java.sql.*; import java.util.Scanner; import java.lang.*; public class Question103 {     public static void main(String...

Monday, March 23, 2020

WEEK 8

QUESTION 1:// Declare a user-defined exceptionclass NegativeValException : public exception {     // LINE-1public:    virtual const char* what() const throw() {        return "Negative value";    }};// Declare a user-defined exceptionclass ZeroValException : public exception {         // LINE-2public:    virtual...

Wednesday, March 18, 2020

WEEK 7 ASSIGNMENT SOLUTION

GUYS I KNOW I WAS SUPER INCONSISTENT AND LATE IN UPLOADING THE SOLUTIONS BUT I WAS HAVING A BUSY TIME IN PAST FEW WEEKS(COLLEGE WORK ) , I AM NOT GIVING ANY EXCUSES BUT JUST LETTING YOU ALL GUYS KNOW WHAT WAS THE REASON DUE TO WHICH I AM UPLOADING VIDEOS SO LATE. AND THANKS FOR WATCHING MY STUFF.  QUESTION 1: import java.util.*; public class Question1{         public static...

Monday, March 16, 2020

WEEK 7 ASSIGNMENT SOLUTION

QUESTION 1:Container& operator =(int val) {      // LINE-1        this->arr[++i] = val;        return *this;    }    operator int()  {      // LINE-2        return arr[i--];    }};QUESTION 2:    virtual void print(int i)=0;         ...

Wednesday, March 11, 2020

WEEK 6 ASSIGNMENT SOLUTION

QUESTION 1: // Write the appropriate code to extend the Thread class to complete the class Question61. public class Question61 extends Thread{ public void run() {   System.out.print("Thread is Running."); } QUESTION 2: // Create main class Question62 with main() method and appropriate statements in it public class Question62{   public static void main(String[] args){     ThreadRun...