Back-End Programming Exam  >  Back-End Programming Tests  >  Learn to Program with C++: Beginner to Expert  >  Class Test - 30-04-2020 - Back-End Programming MCQ

Class Test - 30-04-2020 - Back-End Programming MCQ


Test Description

20 Questions MCQ Test Learn to Program with C++: Beginner to Expert - Class Test - 30-04-2020

Class Test - 30-04-2020 for Back-End Programming 2024 is part of Learn to Program with C++: Beginner to Expert preparation. The Class Test - 30-04-2020 questions and answers have been prepared according to the Back-End Programming exam syllabus.The Class Test - 30-04-2020 MCQs are made for Back-End Programming 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Class Test - 30-04-2020 below.
Solutions of Class Test - 30-04-2020 questions in English are available as part of our Learn to Program with C++: Beginner to Expert for Back-End Programming & Class Test - 30-04-2020 solutions in Hindi for Learn to Program with C++: Beginner to Expert course. Download more important topics, notes, lectures and mock test series for Back-End Programming Exam by signing up for free. Attempt Class Test - 30-04-2020 | 20 questions in 10 minutes | Mock test for Back-End Programming preparation | Free important questions MCQ to study Learn to Program with C++: Beginner to Expert for Back-End Programming Exam | Download free PDF with solutions
Class Test - 30-04-2020 - Question 1

Predict the output of following C++ program.
// Assume that integers take 4 bytes.

#include<iostream>
using namespace std;   
class Test
{
  static int i;
  int j;
};
int Test::i;
int main()
{
    cout << sizeof(Test);
    return 0;
}

Class Test - 30-04-2020 - Question 2

What is the output of following C++ program?

#include<iostream>
using namespace std;

class P {
public:
   void print()
   { cout <<" Inside P::"; }
};
class Q : public P {
public:
   void print()
   { cout <<" Inside Q"; }
};
class R: public Q {
};
int main(void)
{
  R r;
  r.print();
  return 0;
}

1 Crore+ students have signed up on EduRev. Have you? Download the App
Class Test - 30-04-2020 - Question 3

Inline functions are useful when______________________.

Class Test - 30-04-2020 - Question 4

What is the output of following program?

#include<iostream>
using namespace std;
int x = 1;
void fun()
{
    int x = 2;
    {
        int x = 3;
        cout << ::x << endl;
    }
}
int main()

{
    fun();
    return 0;
}

Class Test - 30-04-2020 - Question 5

Which of the following is true about virtual functions in C++.

Class Test - 30-04-2020 - Question 6

Which of the following in Object Oriented Programming is supported by Function overloading and default arguments features of C++.

Class Test - 30-04-2020 - Question 7

How to create a dynamic array of pointers (to integers) of size 10 using new in C++? Here, one can create a non-dynamic array using int *arr[10]

Class Test - 30-04-2020 - Question 8

What is the output of the following program?

#include <iostream>
using namespace std;
int main()
{
   int x = -1;
   try {
      cout << "Inside try \n";
      if (x < 0)
      {
         throw x;
         cout << "After throw \n";
      }
   }
   catch (int x ) {
      cout << "Exception Caught \n";
   }
   cout << "After catch \n";
   return 0;
}

Class Test - 30-04-2020 - Question 9

What is the difference between struct and class in C++?

Class Test - 30-04-2020 - Question 10

Which of the following operators cannot be overloaded?

Class Test - 30-04-2020 - Question 11

A member function can always access the data in __________ .

Class Test - 30-04-2020 - Question 12

What is the output of the following program?
#include <iostream>
using namespace std;
 
class Test
{
  int x;
  Test() { x = 5;}
};
 
int main()
{
   Test *t = new Test;
   cout << t->x;
}

Class Test - 30-04-2020 - Question 13

Predict the output.

#include<iostream>

using namespace std;
class abc {
   public:
      static int x;
      int i;

      abc() {
         i = ++x;
      }
   };
int abc::x;

main() {
   abc m, n, p;
  
   cout<<m.x<<" "<<m.i<<endl;
}

Class Test - 30-04-2020 - Question 14

What should be put in a try block?

1. Statements that might cause exceptions
2. Statements that should be skipped in case of an exception

Class Test - 30-04-2020 - Question 15

What is the output of following program?

#include <stdio.h>
int main()
{
   const int x;
   x = 10;
   printf("%d", x);
   return 0;
}

Class Test - 30-04-2020 - Question 16

What is the use of this pointer?

Class Test - 30-04-2020 - Question 17

What is the built in library function to compare two strings?

Class Test - 30-04-2020 - Question 18

Predict the output.

class Test {
    int x;
};
int main()
{
  Test t;
  cout << t.x;
  return 0;
}

Class Test - 30-04-2020 - Question 19

What is the output of following program?

#include <iostream>
using namespace std;
int fun(int=0, int = 0);
 
int main()
{
  cout << fun(5);
  return 0;
}
int fun(int x, int y)
{
  return (x+y);
}

Class Test - 30-04-2020 - Question 20

Which of the followings is/are automatically added to every class, if we do not write our own?

73 videos|7 docs|23 tests
Information about Class Test - 30-04-2020 Page
In this test you can find the Exam questions for Class Test - 30-04-2020 solved & explained in the simplest way possible. Besides giving Questions and answers for Class Test - 30-04-2020, EduRev gives you an ample number of Online tests for practice
Download as PDF