C++ MCQs with answers Page - 37

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. ____ Operator requires two operands.

  • (A) Ternary
  • (B) Unary
  • (C) Binary
  • (D) Logical

A

Admin • 833.24K Points
Coach

Q. Auto variables get undefined values known as

  • (A) Register
  • (B) Auto
  • (C) Garbage
  • (D) Static

A

Admin • 833.24K Points
Coach

Q. ____ storage class variables are defined in another program.

  • (A) Static
  • (B) Extern
  • (C) Auto
  • (D) Register

A

Admin • 833.24K Points
Coach

Q. ____ Type is used to declare a generic pointer in C++.

  • (A) Float
  • (B) Static
  • (C) Void
  • (D) Int

A

Admin • 833.24K Points
Coach

Q. Which is a conditional operator?

  • (A) @
  • (B) ?:
  • (C) >
  • (D) <

A

Admin • 833.24K Points
Coach

Q. Built in Data type is also called as ___ data type.

  • (A) Integer
  • (B) Void
  • (C) Secondary
  • (D) Fundamental

A

Admin • 833.24K Points
Coach

Q. In which type are enums stored by the compiler?

  • (A) Integer
  • (B) String
  • (C) Float
  • (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;
void add()
{
  static int s = 1;
  s++;
  cout << s;
}
int main()
{
  add();
  add();
  add();
  return 0;
}
  • (A) 122
  • (B) 234
  • (C) 111
  • (D) 123

A

Admin • 833.24K Points
Coach

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

Code:
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
  char str[7] = "ABC";
  cout << str[3];
  cout << str;
  return 0;
}
  • (A) C
  • (B) ABCD
  • (C) ABC
  • (D) CAB

A

Admin • 833.24K Points
Coach

Q. To which type, enumerations can be assigned?

  • (A) Enumeration
  • (B) Integer
  • (C) Float
  • (D) Both A and B

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