C++ MCQs with answers Page - 122

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. Which of the following is not a type of inheritance?

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

A

Admin • 833.24K Points
Coach

Q. Which of the following is correct in C++?

  • (A) Classes cannot have protected data members
  • (B) Structures can have member functions
  • (C) Class members are public by default
  • (D) Structure members are private by default

A

Admin • 833.24K Points
Coach

Q. A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.

  • (A) default constructor
  • (B) copy constructor
  • (C) Both A and B
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. How many default constructors per class are possible?

  • (A) Only one
  • (B) Two
  • (C) Three
  • (D) Unlimited

A

Admin • 833.24K Points
Coach

Q. Which of the following statement is correct?

  • (A) A constructor has the same name as the class in which it is present.
  • (B) A constructor has a different name than the class in which it is present.
  • (C) A constructor always returns an integer.
  • (D) A constructor cannot be overloaded.

A

Admin • 833.24K Points
Coach

Q. A destructor takes __________ arguments.

  • (A) one
  • (B) two
  • (C) three
  • (D) no

A

Admin • 833.24K Points
Coach

Q. Destructor calls are made in which order of the corresponding constructor calls?

  • (A) Reverse order
  • (B) Forward order
  • (C) Depends on how the object is constructed
  • (D) Depends on how many objects are constructed

A

Admin • 833.24K Points
Coach

Q. Which of the following never requires any arguments?

  • (A) Member function
  • (B) Friend function
  • (C) Default constructor
  • (D) const function

A

Admin • 833.24K Points
Coach

Q. A class's __________ is called when an object is destroyed.

  • (A) constructor
  • (B) destructor
  • (C) assignment function
  • (D) copy constructor

A

Admin • 833.24K Points
Coach

Q. How many times a constructor is called in the life‐time of an object?

  • (A) Only once
  • (B) Twice
  • (C) Thrice
  • (D) Depends on the way of creation of object

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