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. Which of the following is correct option?

x = 15, y = 3
x = 3, y = 15
Compile Error
x = 15, y = 15

2. Which of these following members are not accessed by using direct member access operator?

Public
Private
Protected
Both B & C

3. Dereference operator is also called as

pointer
Reference operator
Offset operator
Deoffset operator

4. What is the output of this program?

        
Note:Includes all required header files 
          
using namespace std;
struct a
 {
    int p;
 };
struct b
 {
    int* x;
 };
struct c : public a, public b
 {
 };
int main()
 {
    c* p = new c;
    p->x = 0;
    cout << "Inherited";
    return 0;
 } 

Inherited
Error
Runtime error
None of the mentioned

5. Which of the following is true?

The C++ interfaces are implemented using abstract classes
The purpose of an abstract class is to provide an appropriate base class from which other classes can inherit.
Abstract classes cannot be used to instantiate objects and serves only as an interface.
All of the above

6. C++ runs on ?

Windows
MacOS
UNIX
All of the above

7. Pointer operator * is pointer to a variable.

Yes
No
Can be yes or no
Can not say

8. Which of the following is not a member of class?

Static Function.
Friend Function
Const Function
Virtual Function

9. How to handle exception in constructor, in c++?

We have to return an exception
We have to throw an exception
Both A and B
None of the above

10. Which access specifier can a virtual function have in a base class?

Private
Protected
Public
Any of the above

Results