C++ MCQs with answers Page - 53

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 correct about the statements given below?

1. All operators can be overloaded in C++.
2. We can change the basic meaning of an operator in C++.

  • (A) Only I is true.
  • (B) Only II is true.
  • (C) Both I and II are false.
  • (D) Both I and II are true.

A

Admin • 833.24K Points
Coach

Q. What happens if the base and derived class contains definition of a function with same prototype?

  • (A) Base class object will call base class function and derived class object will call derived class function.
  • (B) Only derived class function will get called irrespective of object.
  • (C) Only base class function will get called irrespective of object.
  • (D) Compiler reports an error on compilation.

A

Admin • 833.24K Points
Coach

Q. Which of the following are available only in the class hierarchy chain?

  • (A) Member functions
  • (B) Protected data members
  • (C) Private data members
  • (D) Public data members

A

Admin • 833.24K Points
Coach

Q. Which of the following is the correct class of the object cout?

  • (A) ifstream
  • (B) ostream
  • (C) istream
  • (D) iostream

A

Admin • 833.24K Points
Coach

Q. Which of the following cannot be used with the keyword virtual?

  • (A) destructor
  • (B) constructor
  • (C) member functions
  • (D) class

A

Admin • 833.24K Points
Coach

Q. Which of the following functions are performed by a constructor?

  • (A) Initialize objects
  • (B) Construct a new function
  • (C) Construct a new object
  • (D) Construct a new class

A

Admin • 833.24K Points
Coach

Q. Which of the following problem causes an exception?

  • (A) A run-time error.
  • (B) A syntax error.
  • (C) A problem in calling function.
  • (D) Missing semicolon in statement in main().

A

Admin • 833.24K Points
Coach

Q. Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object.

  • (A) Encapsulation
  • (B) Abstraction
  • (C) Polymorphism
  • (D) Inheritance

A

Admin • 833.24K Points
Coach

Q. Which of the following is the correct way of declaring a function as constant?

  • (A) const int ShowData(void) { /* statements */ }
  • (B) int const ShowData(void) { /* statements */ }
  • (C) int ShowData(void) const { /* statements */ }
  • (D) Both A and B

A

Admin • 833.24K Points
Coach

Q. Which of the following concepts is used to implement late binding?

  • (A) Static function
  • (B) Const function
  • (C) Operator function
  • (D) Virtual function

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