C++ MCQs with answers Page - 96

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 valid conditional inclusion in preprocessor directives?

  • (A) #elif
  • (B) #endif
  • (C) #ifundef
  • (D) #ifdef

A

Admin • 833.24K Points
Coach

Q. Which one of the following is not a fundamental data type in C++?

  • (A) float
  • (B) string
  • (C) int
  • (D) wchar_t

A

Admin • 833.24K Points
Coach

Q. Which of the following correctly describes C++ language?

  • (A) Dynamically typed language
  • (B) Statically typed language
  • (C) Both Statically and dynamically typed language
  • (D) Type-less language

A

Admin • 833.24K Points
Coach

Q. What is the implicit pointer that is passed as the first argument for non-static member functions?

  • (A) ‘this’ pointer
  • (B) ‘Myself’ pointer
  • (C) std::auto_ptr pointer
  • (D) ‘self’ pointer

A

Admin • 833.24K Points
Coach

Q. Which of the following is not true about preprocessor directives?

  • (A) They form an integral part of the code
  • (B) They have to end with a semi colon
  • (C) They begin with a hash symbol
  • (D) They are processed by a preprocessor

A

Admin • 833.24K Points
Coach

Q. What’s wrong? for (int k = 2, k <=12, k++)

  • (A) The increment should always be ++k
  • (B) The variable must always be the letter i when using a for loop
  • (C) There should be a semicolon at the end of the statement
  • (D) The commas should be semicolons

A

Admin • 833.24K Points
Coach

Q. Which of the following is a valid destructor of the class name “Country”?

  • (A) void ~Country()
  • (B) int ~Country(Country obj)
  • (C) void Country()
  • (D) int ~Country()

A

Admin • 833.24K Points
Coach

Q. Statement scanf(“%d”,80);

  • (A) Assign an float to variable i
  • (B) Print the value of i
  • (C) Give an error message
  • (D) Assign an integer to variable i

A

Admin • 833.24K Points
Coach

Q. If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending loop block?

  • (A) arrows < >
  • (B) brackets [ ]
  • (C) braces { }
  • (D) parentheses ( )

A

Admin • 833.24K Points
Coach

Q. Which of the following is the most common way of implementing C++?

  • (A) C++ programs are directly compiled into native code by a compiler
  • (B) C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine
  • (C) C++ programs are interpreted by an interpreter
  • (D) A C++ editor directly compiles and executes the program

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