Wednesday, October 14, 2020

NPTEL INTRODUCTION TO PROGRAMMING IN C WEEK 4 ANSWERS (JUL-DEC 2020)

 Question 1:#include<stdio.h>int main(){ int arr1[100], arr2[100]; int n1,n2; int check = 1; int i;  int k; scanf("%d",&n1); for( i = 0; i < n1; i++) scanf("%d",&arr1[i]); scanf("%d",&n2); for( i = 0; i < n2; i++ ) scanf("%d",&arr2[i]); for(i = 0; i < n1; i++)//sorting arr1. { for(int j = i; j < n1; j++) { if(arr1[j]>arr1[i]) { int temp =...

Tuesday, October 13, 2020

NPTEL PROGRAMMING IN C++ ASSIGNMENT WEEK 4 ANSWERS 2020(JUL-DEC)

 Question 1 :#include <iostream>using namespace std;class B;             // LINE-1class A {    int a_ = 0;public:    A(int x) : a_(x) { }    int addB(B&);    int subtractB(B&);};class B {    int b_ = 5;public:    friend class A;         // LINE-2};Question 2:Complex...

Saturday, October 10, 2020

NPTEL PROGRAMMING IN JAVA WEEK 4 ANSWERS (JUL-DEC 2020)

 QUESTION 1:import java.io.*;import java.util.*;import static java.lang.System.*;QUESTION 2: // Create an object of Calendar class. java.util.Calendar current ; // Use getInstance() method to initialize the Calendar object.current = java.util.Calendar.getInstance(); // Initialize the int variable year with the current yearyear = current.get(current.YEAR);QUESTION 3:interface ExtraLarge{...

Tuesday, October 6, 2020

NPTEL PROGRAMMING IN C++ ASSIGNMENT WEEK 3 ANSWERS 2020(JUL-DEC) || CODE LINK IN THE COMMENTS

 Question 1: triangle(int b, int h) : _base(&b), _height(&h) { } // Line-1    // LINE-1: Complete Constructor definition    ~triangle() {        _base = 0; // Line-2        _height = 0;// LINE-2: Complete destructor to delete both data pointers    }    double area();};double triangle::area() {  //...

Monday, October 5, 2020

NPTEL PROGRAMMING IN JAVA WEEK 3 ANSWERS (JUL-DEC 2020)

QUESTION 1:if (n<=1)             return (1-n);         return fib(n - 1) + fib(n - 2); QUESTION 2:class Point{   double x,y;      public double distance(Point p1, Point p2)                {                   ...

Wednesday, September 30, 2020

NPTEL INTRODUCTION TO PROGRAMMING IN C WEEK 3 ANSWERS (JUL-DEC 2020)

 Question 1:#include<stdio.h>int find_odd(int k){  int num;  int counter = 0;  int check = 0;    while(num != -1)  {    scanf("%d",&num);    if(num%2!=0)    {      counter++;      if(counter == k)      {        printf("%d",num);       ...

Thursday, September 24, 2020

NPTEL PROGRAMMING IN JAVA WEEK 2 ANSWERS (JUL-DEC 2020)

 Question 1:// Create an object of class Student// Call 'print()' method of class Student // Create an object of class School// Call 'print()' method of class SchoolStudent obj = new Student();obj.print();School obj_1 = new School();obj_1.print(); Question 2:// Create an object of class Printer// Call 'print()' methods for desired outputPrinter obj = new Printer();obj.print("Hi! I am...

Wednesday, September 23, 2020

NPTEL INTRODUCTION TO PROGRAMMING IN C WEEK 2 ANSWERS (JUL-DEC 2020)

Question 1:#include<stdio.h>int main(){  int arr[50][50];  int n;  int upper = 1, lower = 1;  scanf("%d",&n);    for(int i=0; i<n; i++)  {    for(int j=0; j<n; j++)      scanf("%d",&arr[i][j]);  }    for(int i=0; i<n; i++)  {    for(int j=0; j<n; j++)    {   ...

NPTEL PROGRAMMING IN C++ ASSIGNMENT WEEK 2 ANSWERS 2020(JUL-DEC)

 Question 1:Complex operator*(Complex &p1, Complex &p2) { // LINE-1    struct Complex p3 = { 0, 0 };    p3.x = (p1.x)*(p2.x) - (p1.y)*(p2.y); // LINE-2    p3.y = (p1.x)*(p2.y) + (p1.y)*(p2.x); // LINE-3    return p3;}Question 2:#include <iostream>#include <string>using namespace std;void print(string a, string b = "Anyone") { // LINE-1Question...

Monday, September 14, 2020

Programming in Java WEEK 1 NPTEL(JULY - DEC 2020) ASSIGNMNET SOL.

Question 1:  if(radius>0)       { perimeter = 2*Math.PI*radius;     area = (Math.PI)*radius*radius;          System.out.println(perimeter);          System.out.print(area);       } else       System.out.print("please enter non zero positive number");Question 2://Use...

Programming in C++ WEEK 1 NPTEL(JULY-DEC 2020) ASSIGNMNET SOL.

 Question 1 :stack<char> s;    // LINE-1        for (int i = 0; i < strlen(str); i++)        s.push(str[i]);    // LINE-2Question 2 :bool StrCmp(string s1, string s2) {    if (s1.length()>s2.length() || s1.length()<s2.length())    // LINE-1            return 1; ...

Sunday, September 13, 2020

Introduction to Programming in C week 1 NPTEL(JULY - DEC 2020) assignmnet solution

 Question 1 :#include<stdio.h>void  main(){  int arr[4];  for(int i=0; i<3; i++)    scanf("%d",&arr[i]);    //To take input.    int sum = arr[0] + arr[1];     if(sum>arr[2]) //if statement to check wether third number is smaller than the sum of    printf("1"); //first two.  else  ...

Saturday, August 1, 2020

GTA San Andreas 2.00 Full Apk + Data for Android 2020

Five years ago, Carl Johnson escaped from the pressures of life in Los Santos, San Andreas, a city tearing itself apart with gang trouble, drugs and corruption. Where filmstars and millionaires do their best to avoid the dealers and gangbangers. Now, it’s the early 90’s. Carl’s got to go home....

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...

Saturday, March 7, 2020

WEEK 6 ASSIGNMENT SOLUTION

QUESTION 1:virtual void compute(){ n = n*n; }           // LINE-1       virtual void show(){ cout << n << endl; } // LINE-2};QUESTION 2:Base::f();          // LINE-1 Call proper function        cout << name << endl;    }    void g() {       ...

Wednesday, March 4, 2020

WEEK 5 ASSIGNMENT SOLUTION

QUESTION 1 : //Create a class A which implements the interface Number. class A implements Number {   public int findSqr(int i)   {     return i*i;   } } QUESTION 2:   //Create a class B, which implements the interface GCD. class B implements GCD {   public int findGCD(int a, int b)   {     if(b==0)       return a;    ...

Monday, February 24, 2020

WEEK 4 ASSIGNMENT

QUESTION 1: import java.io.*; import java.util.*; import static java.lang.System.*; QUESTION 2: // Create an object of Calendar class.  java.util.Calendar current ; // Use getInstance() method to initialize the Calendar object. current = java.util.Calendar.getInstance(); // Initialize the int variable year with the current year year = current.get(current.YEAR); QUESTION 3: interface...

Saturday, February 15, 2020

WEEK 3 ASSIGNMENT SOLUTION

HEY! GUYS HERE IS THE CODE OF ALL THE QUESTIONS: QUESTION 1: if (n<=1)              return (1-n);          return fib(n - 1) + fib(n - 2);  QUESTION 2: class Point{   double x,y;     public double distance(Point p1, Point p2)                 {  ...

Tuesday, February 11, 2020

PROGRAMMING IN C++ WEEK 3

HELLO!! FRIENDS HERE I HAVE PASTED ONLY THE SOLUTION AND NOT THE COMPLETE PROGRAM SO PASTE IT CAREFULLY IN YOUR SOLUTION.QUESTION 1:mutable int bill;                  // LINE-1public:    Customer(int _cust_id, string _name, int _bill)        : cust_id(_cust_id), name(_name), bill(_bill) {}    void changeBill(int s)const...

Sunday, February 2, 2020

PROGRAMMING IN JAVA WEEK 1 ASSIGNMENT SOLUTION

Here I have pasted only the answer and not the complete program so please paste the stuff carefully, I have tried to copy the whole program but it is not selecting the whole program at once. QUESTION 1 : //Calculate the perimeter  perimeter=2*Math.PI*radius; //Calculate the area area=Math.PI*radius*radius; if(area>0&&perimeter>0)         {    ...

Sunday, January 26, 2020

SIX WAYS TO MAKE PEOPLE LIKE YOU

We are often curious of how will  people react after meeting us for first time when we move to a new place, joined a new job, etc. Here I am listing six ways to as per my knowledge which you can apply in your life to make people like you especially if you are meeting them first time.1. BECOME GENUINELY INTERESTED...