C++ MCQs with answers Page - 68

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 C++?

  • (A) C++ is an object oriented programming language
  • (B) C++ is a procedural programming language
  • (C) C++ supports both procedural and object oriented programming language
  • (D) C++ is a functional programming language

A

Admin • 833.24K Points
Coach

Q. Which of the following is a correct identifier in C++?

  • (A) VAR_5555
  • (B) 8VARNAME
  • (C) $var_name
  • (D) 9var_name

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a type of Constructor in C++?

  • (A) Default constructor
  • (B) Parameterized constructor
  • (C) Copy constructor
  • (D) Friend constructor

A

Admin • 833.24K Points
Coach

Q. Which of the following approach is used by C++?

  • (A) Top-down
  • (B) Left-right
  • (C) Right-left
  • (D) Bottom-up

A

Admin • 833.24K Points
Coach

Q. What is virtual inheritance in C++?

  • (A) C++ technique to enhance multiple inheritance
  • (B) C++ technique to ensure that a private member of the base class can be accessed somehow
  • (C) C++ technique to avoid multiple inheritances of classes
  • (D) C++ technique to avoid multiple copies of the base class into children/derived class

A

Admin • 833.24K Points
Coach

Q. What happens if the following C++ statement is compiled and executed?

Code:
int *ptr = NULL;
delete ptr;
  • (A) The program is not semantically correct
  • (B) The program compiled successfully but throws an error during run-time
  • (C) The program gives a compile-time error
  • (D) The program is compiled and executed successfully

A

Admin • 833.24K Points
Coach

Q. What will be the output of the following C++ code?

Code:
#include <iostream> 
#include <string>
using namespace std; 
int main(int argc, char const *argv[])
{
	char s1[6] = "Hello";
	char s2[6] = "World";
	char s3[12] = s1 + " " + s2;
	cout<<s3;
	return 0;
}
  • (A) Hello
  • (B) World
  • (C) Error
  • (D) Hello World

A

Admin • 833.24K Points
Coach

Q. Which concepts does the Pre Increment use?

  • (A) queue
  • (B) call by reference
  • (C) call by value
  • (D) All of above

A

Admin • 833.24K Points
Coach

Q. Pick out the correct statement

  • (A) post-increment is faster than Pre Increment
  • (B) pre increment is slower than post-increment
  • (C) Pre Increment is faster than post-increment
  • (D) All of above

A

Admin • 833.24K Points
Coach

Q. Which concept do we use for the implementation of late binding?

  • (A) Static Functions
  • (B) Constant Functions
  • (C) Operator Functions
  • (D) Virtual Functions

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