C++ Programming Quiz


Play this c++ quiz that will help you to excel in C++ certification exams, placements etc. This C++ programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This C++ programming test enables you to assess your knowledge of C++ programming.

Take the Free Practice Test



C++ MCQs

Practice C++ MCQ Questions, which will help you to understand C++ programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

C++ Quiz

Try Free C++ Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

C++ Quiz

1. Where does the object is created?

Class
Constructor
Destructors
Attributes

2. How many types of templates are there in c++?

1
2
3
4

3. Which of the following is false?

Friendship is not inherited
The concept of friends is there in Java.
Both A and B
None of the above

4. The maths function acos (x) stands for

Inverse Cosine of x
Inverse Sine of x
Inverse Tangent of x
Floor of x

5. Uncaught exception will call which function?

Terminate
Catch
None of the above
Throw

6. What is the output of this program?

#include <iostream>
using namespace std;

int main()
{
    try
    {
       throw 10;
    }
    catch (...)
    {
        cout << "Default Exceptionn";
    }
    catch (int param)
    {
        cout << "Int Exceptionn";
    }
    return 0;
}

Default Exception
Int Exception
Compiler Error
None of the above

7. Which of the following is true about the following program

#include <iostream>

using namespace std;
template <class P, class Q, class R>
class A  {
    P x;
    Q y;
    R z;
    static int count;
};

int main()
{
   A<int, int, int> m;
   A<char, char, char> n;
   cout << sizeof(m) << endl;
   cout << sizeof(n) << endl;
   return 0;
}  

Compiler Error: template parameters cannot have default values
12 6
12 3
6 3

8. What will be the output of this program?

Note:Includes all required header files
 using namespace std;
     int max(int p, int q )
    {
        return ( p > q ? p : q );
    }
    int main()
    {
        int x = 25;
        int y = 50;
        cout << max(x, y );
        return 0;
    }  

25
50
either 25 or 50
none of the mentioned

9. How many pillars of object-oriented development?

2
3
4
5

10. Which of the following is true?

All objects of a class share all data members of class
Objects of a class do not share non-static members. Every object has its own copy
Objects of a class do not share codes of non-static methods, they have their own copy
None of these

Results