C++ MCQs with answers Page - 51

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. What will happen if a class is not having any name?

  • (A) It is not allowed.
  • (B) It cannot have a destructor.
  • (C) It cannot have a constructor.
  • (D) Both B and C.

A

Admin • 833.24K Points
Coach

Q. Which inheritance type is used in the class given below?
class A : public X, public Y
{}

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

A

Admin • 833.24K Points
Coach

Q. Which one of the following is correct about the statements given below?
1. All function calls are resolved at compile-time in Procedure Oriented Programming.
2. All function calls are resolved at compile-time in OOPS.

  • (A) Only II is correct.
  • (B) Both I and II are correct.
  • (C) Only I is correct.
  • (D) Both I and II are incorrect.

A

Admin • 833.24K Points
Coach

Q. Which of the following is an invalid visibility label while inheriting a class?

  • (A) private
  • (B) friend
  • (C) protected
  • (D) public

A

Admin • 833.24K Points
Coach

Q. Which of the following concepts means adding new components to a program as it runs?

  • (A) Dynamic loading
  • (B) Dynamic binding
  • (C) Dynamic typing
  • (D) Data hiding

A

Admin • 833.24K Points
Coach

Q. Which of the following statement is correct?

  • (A) A constructor is called at the time of use of a class.
  • (B) A constructor is called at the time of declaration of a class.
  • (C) A constructor is called at the time of use of an object.
  • (D) A constructor is called at the time of declaration of an object.

A

Admin • 833.24K Points
Coach

Q. Which of the following correctly describes overloading of functions?

  • (A) Pseudo polymorphism
  • (B) Ad-hoc polymorphism
  • (C) Transient polymorphism
  • (D) Virtual polymorphism

A

Admin • 833.24K Points
Coach

Q. Which of the following approach is adapted by C++?

  • (A) Left-right
  • (B) Right-left
  • (C) Bottom-up
  • (D) Top-down

A

Admin • 833.24K Points
Coach

Q. Which of the following is correct about function overloading?

  • (A) The number of argument is same.
  • (B) The types of arguments are different.
  • (C) The order of argument is different.
  • (D) Both B and C.

A

Admin • 833.24K Points
Coach

Q. Which of the following operators cannot be overloaded?

  • (A) *
  • (B) ?:
  • (C) ->
  • (D) []