C++ MCQs with answers Page - 57

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. The process of building new classes from existing one is called ______.

  • (A) Cascading
  • (B) Inheritance
  • (C) Structure
  • (D) Polymorphism

A

Admin • 833.24K Points
Coach

Q. If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access

  • (A) protected and public data only in C and B.
  • (B) protected and public data only in C.
  • (C) private data in A and B.
  • (D) protected data in A and B.

A

Admin • 833.24K Points
Coach

Q. If the variable count exceeds 100, a single statement that prints “Too many” is

  • (A) if (count>100) cout << “Too many”;
  • (B) if (count<100) cout << “Too many”;
  • (C) if (count>100) cout >> “Too many”;
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Usually a pure virtual function

  • (A) is defined only in derived class.
  • (B) will be called only to delete an object.
  • (C) will never be called.
  • (D) has complete function body.

A

Admin • 833.24K Points
Coach

Q. To perform stream I/O with disk files in C++, you should

  • (A) include the IOSTREAM.H header file.
  • (B) use C language library functions to read and write data.
  • (C) use classes derived from ios
  • (D) open and close files as in procedural languages

A

Admin • 833.24K Points
Coach

Q. . Overloading the function operator

  • (A) usually make use of a constructor that takes arguments.
  • (B) allows you to create objects that act syntactically like functions
  • (C) requires a class with an overloaded [ ] operator.
  • (D) requires a class with an overloaded operator.

A

Admin • 833.24K Points
Coach

Q. If x = y,5 = 2 then x ∧ y equals________. (where ∧ is a bitwise XOR operator)

  • (A) 11001000
  • (B) 10100000
  • (C) 10000010
  • (D) 00000111

A

Admin • 833.24K Points
Coach

Q. What will be the result of the expression 13 & 25?

  • (A) 9
  • (B) 12
  • (C) 25
  • (D) 38

A

Admin • 833.24K Points
Coach

Q. Which of the following operator can be overloaded through friend function?

  • (A) *
  • (B) ( )
  • (C) =
  • (D) ->

A

Admin • 833.24K Points
Coach

Q. To access the public function fbase() in the base class, a statement in a derived class function fder() uses the statement.fbase();

  • (A) der::fder();
  • (B) base::fbase();
  • (C) fder();
  • (D) fbase();

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