C++ MCQs with answers Page - 40

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 keyword is used to catch an exception in the code block?

  • (A) throw
  • (B) catch
  • (C) try
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. What happens if the exception is not caught in the program?

  • (A) Error
  • (B) The program will be executed.
  • (C) The block of this code will not be executed
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. What is the maximum number of arguments or parameters that can be used in a function call?

  • (A) 254
  • (B) 255
  • (C) 256
  • (D) 64

A

Admin • 833.24K Points
Coach

Q. Which keyword is used to define macros in C++?

  • (A) #define
  • (B) macro
  • (C) define
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. What is the output of the following C++ code?

Code:
#include <iostream>
using namespace std;
int sum(int a, int b, int c)
{
  return a + b;
}
double sum(double a, double b, double c)
{
  return a + b;
}
int main()
{
  cout << sum(1, 2);
  cout << sum(1.5, 2.5);
  return 0;
}
  • (A) Compilation error
  • (B) 3 4.5
  • (C) 4 3
  • (D) 3 4

A

Admin • 833.24K Points
Coach

Q. Which symbol is used to declare preprocessor directives?

  • (A) &
  • (B) %
  • (C) #
  • (D) $

A

Admin • 833.24K Points
Coach

Q. Delaration a pointer more than once may cause ____

  • (A) Null
  • (B) Trap
  • (C) Abort
  • (D) Error

A

Admin • 833.24K Points
Coach

Q. Which one is not a correct variable type in C++?

  • (A) double
  • (B) int
  • (C) real
  • (D) float

A

Admin • 833.24K Points
Coach

Q. 0

  • (A) Operator +
  • (B) Operator-&&
  • (C) Operator-||
  • (D) Operator-&

A

Admin • 833.24K Points
Coach

Q. An expression A.B in C++ means ____

  • (A) B is member of Object A
  • (B) A is member of object B
  • (C) Product of A and B
  • (D) None of these

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