C++ MCQs with answers Page - 64

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. What happens when a pointer is deleted twice?

  • (A) It can cause a trap
  • (B) It can cause an error
  • (C) It can cause a failure
  • (D) It can abort the program

A

Admin • 833.24K Points
Coach

Q. Which of the following language feature is not an access specifier in C++?

  • (A) internal
  • (B) C protected
  • (C) private
  • (D) public

A

Admin • 833.24K Points
Coach

Q. Expression C=i++ causes

  • (A) Value of i assigned to C and then i incremented by 1
  • (B) to be incremented by 1 and then value of i assigned to C
  • (C) Value of i assigned to C
  • (D) i to be incremented by 1

A

Admin • 833.24K Points
Coach

Q. The statement i++; is equivalent to

  • (A) i = i + i;
  • (B) i = i + 1;
  • (C) i = i – 1;
  • (D) i –;

A

Admin • 833.24K Points
Coach

Q. In C language, a hexadecimal number is represented by writing

  • (A) h
  • (B) ox
  • (C) xo
  • (D) x

A

Admin • 833.24K Points
Coach

Q. Which of the following library function below by default aborts the program?

  • (A) exit()
  • (B) Abort()
  • (C) end()
  • (D) Terminate()

A

Admin • 833.24K Points
Coach

Q. If a member needs to have unique value for all the objects of that same class, declare the member as

  • (A) Dynamic variable inside class
  • (B) Static variable inside class
  • (C) Local variable inside constructor
  • (D) Global variable outside class

A

Admin • 833.24K Points
Coach

Q. Value of ix+j, if i,j are integer type and ix long type would be

  • (A) double percision
  • (B) long integer
  • (C) float
  • (D) integer

A

Admin • 833.24K Points
Coach

Q. Which of the following below can perform conversions between pointers to related classes?

  • (A) cast_static
  • (B) dynamic_cast
  • (C) static_cast
  • (D) cast_dynamic

A

Admin • 833.24K Points
Coach

Q. How do we define a constructor?

  • (A) x~() {}
  • (B) X() {}~
  • (C) X() ~{}
  • (D) ~X() {}

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