C++ MCQs with answers Page - 127

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 function contain in the ios class to set flags

  • (A) width()
  • (B) precision()
  • (C) fill()
  • (D) setf()

A

Admin • 833.24K Points
Coach

Q. A private member function can be called by another function that is a member of a class is called

  • (A) Friend function
  • (B) Nesting of member function
  • (C) Inline function
  • (D) Static function

A

Admin • 833.24K Points
Coach

Q. The function that is a bridge between two classes

  • (A) Friend function
  • (B) Nesting of member function
  • (C) Inline function
  • (D) Static function

A

Admin • 833.24K Points
Coach

Q. The break statement causes an exit

  • (A) from the innermost loop only.
  • (B) only from the innermost switch.
  • (C) from all loops & switches.
  • (D) from the innermost loop or switch.

A

Admin • 833.24K Points
Coach

Q. The arrays of variable that are of the type class

  • (A) Array of object
  • (B) pointer
  • (C) Object
  • (D) Structure

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a type of constructor?

  • (A) Copy constructor
  • (B) Friend constructor
  • (C) Default constructor
  • (D) Parameterized construct

A

Admin • 833.24K Points
Coach

Q. Which of the following statements is incorrect?

  • (A) Friend keyword can be used in the class to allow access to another class.
  • (B) Friend keyword can be used for a function in the public section of a class.
  • (C) Friend keyword can be used for a function in the private section of a class.
  • (D) Friend keyword can be used on main().

A

Admin • 833.24K Points
Coach

Q. Which of the following statement is correct regarding destructor of base class?

  • (A) Destructor of base class should always be static.
  • (B) Destructor of base class should always be virtual.
  • (C) Destructor of base class should not be virtual.
  • (D) Destructor of base class should always be private.

A

Admin • 833.24K Points
Coach

Q. How can we make a class abstract?

  • (A) By making all member functions constant.
  • (B) By making at least one member function as pure virtual function.
  • (C) By declaring it abstract using the static keyword.
  • (D) By declaring it abstract using the virtual keyword.

A

Admin • 833.24K Points
Coach

Q. Which of the following statements is correct when a class is inherited publicly?

  • (A) Public members of the base class become protected members of derived class.
  • (B) Public members of the base class become private members of derived class.
  • (C) Private members of the base class become protected members of derived class.
  • (D) Public members of the base class become public members of derived class.

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