C++ MCQs with answers Page - 36

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 is an inline function?

  • (A) function to increase the execution time of a program.
  • (B) A function whose semantic analysis is not verified
  • (C) A function called during compilation
  • (D) A function that is not checked for syntax errors

A

Admin • 833.24K Points
Coach

Q. How many minimum functions must be present in a C++ program to run it?

  • (A) 3
  • (B) 2
  • (C) 1
  • (D) 0

A

Admin • 833.24K Points
Coach

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

Code:
#include<iostream>
using namespace std;
 
int fun(int a = 0, int b = 0, int c)
{  return (a + b + c); }
 
int main()
{
   cout << fun(2);
   return 0;
}
  • (A) 0
  • (B) 2
  • (C) Compilation error
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which keyword do you use if you do not want to get a return value?

  • (A) static
  • (B) void
  • (C) const
  • (D) volatile

A

Admin • 833.24K Points
Coach

Q. From which function does the execution of a C++ program start?

  • (A) Start() function
  • (B) new() function
  • (C) main() function
  • (D) All the answers are true

A

Admin • 833.24K Points
Coach

Q. What is the value of x?

Code:
#include <iostream>
using namespace std;
void f(int &x)
{
  x = 3;
}
int main()
{
  int x = 2;
  f(x);
  cout << "The value of x is " << x;
  return 0;
}
  • (A) 3
  • (B) 2
  • (C) Compilation error
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a C++ keyword?

  • (A) This
  • (B) Cont
  • (C) New
  • (D) If

A

Admin • 833.24K Points
Coach

Q. ____ is a variable that holds a memory address.

  • (A) Long double
  • (B) Char
  • (C) Pointer
  • (D) Float

A

Admin • 833.24K Points
Coach

Q. Addressing is done using ___ number system.

  • (A) Binary
  • (B) Octal
  • (C) Hexadecimal
  • (D) Decimal

A

Admin • 833.24K Points
Coach

Q. Which one of the following is a membership operator?

  • (A) !
  • (B) &
  • (C) ::
  • (D) .

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