C++ MCQs with answers Page - 117

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 not a correct statement?

  • (A) Every class containing abstract method must be declared abstract.
  • (B) Abstract class can directly be initiated with ‘new’ operator.
  • (C) Abstract class can be initiated.
  • (D) Abstract class does not contain any definition of implementation.

A

Admin • 833.24K Points
Coach

Q. When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass _____ the method in the superclass.

  • (A) Overloads
  • (B) Friendships
  • (C) Inherits
  • (D) Overrides

A

Admin • 833.24K Points
Coach

Q. When one object reference variable is assigned to another object reference variable then

  • (A) a copy of the object is created.
  • (B) a copy of the reference is created.
  • (C) a copy of the reference is not created.
  • (D) it is illegal to assign one object reference variable to another object reference variable.

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a member of class?

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

A

Admin • 833.24K Points
Coach

Q. How can we restrict dynamic allocation of objects of a class using new?

  • (A) By overloading new operator
  • (B) By making an empty private new operator.
  • (C) By making an empty private new and new[] operators
  • (D) By overloading new operator and new[] operators

A

Admin • 833.24K Points
Coach

Q. Which of the following operators cannot be overloaded?

  • (A) . (Member Access or Dot operator)
  • (B) ?: (Ternary or Conditional Operator)
  • (C) :: (Scope Resolution Operator)
  • (D) All of the above

A

Admin • 833.24K Points
Coach

Q. Which of the following operators are overloaded by default by the compiler in every user defined classes even if user has not written? 1) Comparison Operator (==) 2) Assignment Operator (=)

  • (A) Both 1 and 2
  • (B) Only 1
  • (C) Only 2
  • (D) None of the two

A

Admin • 833.24K Points
Coach

Q. Which of the following operators should be preferred to overload as a global function rather than a member method?

  • (A) Postfix ++
  • (B) Comparison Operator
  • (C) Insertion Operator <<
  • (D) Prefix++

A

Admin • 833.24K Points
Coach

Q. How C++ compiler does differ between overloaded postfix and prefix operators?

  • (A) C++ doesn’t allow both operators to be overloaded in a class
  • (B) A postfix ++ has a dummy parameter
  • (C) A prefix ++ has a dummy parameter
  • (D) By making prefix ++ as a global function and postfix as a member function.

A

Admin • 833.24K Points
Coach

Q. Which of the following operator functions cannot be global?

  • (A) new
  • (B) delete
  • (C) Conversion Operator
  • (D) All of the above

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