C++ MCQs with answers Page - 159

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 operators is used for object dereferencing in C++?

  • (A) *
  • (B) &
  • (C) ->
  • (D) ::

A

Admin • 833.24K Points
Coach

Q. Which of the following is used to handle exceptions in C++?

  • (A) try and catch
  • (B) error handling functions
  • (C) exception class
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. Which C++ feature allows a function to be redefined in a derived class?

  • (A) Function Overloading
  • (B) Function Overriding
  • (C) Encapsulation
  • (D) Polymorphism

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a valid C++ identifier?

  • (A) _variable
  • (B) 123variable
  • (C) variable_123
  • (D) VariableName

A

Admin • 833.24K Points
Coach

Q. Which keyword is used to define a constant variable in C++?

  • (A) constant
  • (B) define
  • (C) const
  • (D) static

A

Admin • 833.24K Points
Coach

Q. Which of the following is a correct declaration of a C++ array?

  • (A) array<int> a;
  • (B) int a[10];
  • (C) int a;
  • (D) arr int[10];

A

Admin • 833.24K Points
Coach

Q. Which function is used to read a full line of text in C++?

  • (A) cin
  • (B) getline()
  • (C) read()
  • (D) extract()

A

Admin • 833.24K Points
Coach

Q. Which of the following is true about multiple inheritance in C++?

  • (A) A derived class can inherit from more than one base class.
  • (B) It is not allowed in C++.
  • (C) A base class can inherit from a derived class.
  • (D) It is the same as single inheritance.

A

Admin • 833.24K Points
Coach

Q. Which of the following is used to allocate memory dynamically in C++?

  • (A) malloc
  • (B) new
  • (C) allocate
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a valid loop statement in C++?

  • (A) for
  • (B) while
  • (C) repeat-until
  • (D) do-while

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