Explore topic-wise MCQs in C++ (MCQ) questions and answers.

This section includes 3 Mcqs, each offering curated multiple-choice questions to sharpen your C++ (MCQ) questions and answers knowledge and support exam preparation. Choose a topic below to get started.

1.

In case of inheritance where both base and derived class are having constructor and destructor, then which if the following are true ?1. Constructors are executed in their order of derivation2. Constructors are executed in reverse order of derivation3. Destructors are executed in their order of derivation4. Destructors are executed in reverse order of derivation

A. Only 2 ,4
B. Only 1 , 3
C. Only 1 , 4
D. Only 2, 3
Answer» D. Only 2, 3
2.

When base class is derived in protected mode, then_____________ .1. public members of base class become private members of derived class.2. public members of base class become protected members of derived class.3. public members of base class become public members of derived class.4. protected members of base class become protected members of derived class. 5. protected members of base class become private members of derived class.6. protected members of base class become public members of derived class.

A. Only 1, 5
B. Only 1, 6
C. Only 2, 6
D. Only 2, 4
Answer» E.
3.

During a class inheritance in CPP, if the visibility mode or mode of derivation is not provided, then by default visibility mode is___________.

A. public
B. protected
C. private
D. Friend
Answer» D. Friend