C++ MCQs with answers Page - 26

Here, you will find a collection of MCQ questions on C++. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. When a child class inherits traits from more than one parent class, this type of inheritance is called _______________ inheritance.

  • (A) Hybrid
  • (B) Multiple
  • (C) Multilevel
  • (D) Hierarchical

A

Admin • 833.24K Points
Coach

Q. 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 derivation
2. Constructors are executed in reverse order of derivation
3. Destructors are executed in their order of derivation
4. Destructors are executed in reverse order of derivation

  • (A) Only 2 ,4
  • (B) Only 1 , 4
  • (C) Only 2, 3
  • (D) Only 1 , 3

A

Admin • 833.24K Points
Coach

Q. __________________ is the OOP feature and mechanism that binds together code and the data it manipulates, and keep both safe from outside world

  • (A) Data Binding
  • (B) Data Storing
  • (C) Data Abstraction
  • (D) Data Encapsulation

A

Admin • 833.24K Points
Coach

Q. Which of the followings is/are not keyword/s in CPP?

1. asm
2. boolean
3. mutable
4. export
5. constant_cast

  • (A) Only 2 and 5
  • (B) Only 1,2 and 5
  • (C) Only 5
  • (D) Only 1 and 4

A

Admin • 833.24K Points
Coach

Q. Which of the followings are true about Virtual functions?

  • (A) They cannot be friends
  • (B) Constructor Functions cannot be virtual
  • (C) They must be non-static member function of the class
  • (D) All of these

A

Admin • 833.24K Points
Coach

Q. Which of the following are member dereferencing operators in CPP?

1. *
2. ::
3. ->*
4. ::*
5. ->

  • (A) Only 3 and 4
  • (B) Only 1, 3, 4
  • (C) Only 1 and 5
  • (D) Only 3,4,5

A

Admin • 833.24K Points
Coach

Q. In Multipath inheritance, in order to remove duplicate set of records in child class, we ___________ .

  • (A) Make base class as virtual base class
  • (B) Write virtual functions is base class
  • (C) Write Virtual function in parent classes
  • (D) All of these

A

Admin • 833.24K Points
Coach

Q. If base class has constructor with arguments, then it is ________________ for the derived class to have constructor and pass the arguments to base class constructor.

  • (A) Error
  • (B) Compiler dependent
  • (C) Mandatory
  • (D) Optional

A

Admin • 833.24K Points
Coach

Q. Using friend operator function, following perfect set of operators may not be overloaded.

  • (A) <<, = = , [ ] , >>
  • (B) ?, = , ( ) , ++
  • (C) = , ( ) , [ ] , ->
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. An operator function is created using _____________ keyword.

  • (A) iterator
  • (B) operator
  • (C) allocator
  • (D) constructor

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ