C++ MCQs with answers Page - 128

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 access specifies is used in a class definition by default?

  • (A) Protected
  • (B) Public
  • (C) Private
  • (D) Friend

A

Admin • 833.24K Points
Coach

Q. Which of the following statement is correct with respect to the use of friend keyword inside a class?

  • (A) A private data member can be declared as a friend.
  • (B) A class may be declared as a friend.
  • (C) An object may be declared as a friend.
  • (D) We can use friend keyword as a class name.

A

Admin • 833.24K Points
Coach

Q. Which of the following keywords is used to control access to a class member?

  • (A) Default
  • (B) Break
  • (C) Protected
  • (D) Asm

A

Admin • 833.24K Points
Coach

Q. Which of the following type of data member can be shared by all instances of its class?

  • (A) Public
  • (B) Inherited
  • (C) Static
  • (D) Friend

A

Admin • 833.24K Points
Coach

Q. Constructor is executed when _____.

  • (A) an object is created
  • (B) an object is used
  • (C) a class is declared
  • (D) an object goes out of scope.

A

Admin • 833.24K Points
Coach

Q. Which of the following also known as an instance of a class?

  • (A) Friend Functions
  • (B) Object
  • (C) Member Functions
  • (D) Member Variables

A

Admin • 833.24K Points
Coach

Q. How many objects can be created from an abstract class?

  • (A) Zero
  • (B) One
  • (C) Two
  • (D) As many as we want

A

Admin • 833.24K Points
Coach

Q. Which of the following statements is correct?

  • (A) Data items in a class must be private.
  • (B) Both data and functions can be either private or public.
  • (C) Member functions of a class must be private.
  • (D) Constructor of a class cannot be private.

A

Admin • 833.24K Points
Coach

Q. Which of the following can be overloaded?

  • (A) Object
  • (B) Functions
  • (C) Operators
  • (D) Both B and C

A

Admin • 833.24K Points
Coach

Q. Which of the following is the only technical difference between structures and classes in C++?

  • (A) Member function and data are by default protected in structures but private in classes.
  • (B) Member function and data are by default private in structures but public in classes.
  • (C) Member function and data are by default public in structures but private in classes.
  • (D) Member function and data are by default public in structures but protected in classes.

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