C++ Quiz MCQ Question and Answer

Categories: C++ MCQ

C++ Quiz MCQ Question and Answer

 

1) Which of the following is the correct syntax to add the header file in the C++ program?

  1. #include<userdefined>
  2. #include "userdefined.h"
  3. <include> "userdefined.h"
  4. Both A and B

Answer: D

 

2) Which of the following is the correct syntax to print the message in C++ language?

  1. cout <<"Hello world!";
  2. Cout << Hello world! ;
  3. Out <<"Hello world!;
  4. None of the above

Answer: A

 

3) Which of the following is the correct identifier?

  1. $var_name
  2. VAR_123
  3. varname@
  4. None of the above

Answer: B

 

4) Which of the following is the address operator?

  1. @
  2. #
  3. &
  4. %

Answer: C

 

5) Which of the following features must be supported by any programming language to become a pure object-oriented programming language?

  1. Encapsulation
  2. Inheritance
  3. Polymorphism
  4. All of the above

Answer: D

 

6) The programming language that has the ability to create new data types is called.

  1. Overloaded
  2. Encapsulated
  3. Reprehensible
  4. Extensible

Answer: D

 

7) Which of the following is the original creator of the C++ language?

  1. Dennis Ritchie
  2. Ken Thompson
  3. Bjarne Stroustrup
  4. Brian Kernighan

Answer: C

 

8) Which of the following is the correct syntax to read the single character to console in the C++ language?

  1. Read ch()
  2. Getline vh()
  3. get(ch)
  4. Scanf(ch)

Answer: C

 

9) Which of the following statements is correct about the formal parameters in C++?

  1. Parameters with which functions are called
  2. Parameters which are used in the definition of the function
  3. Variables other than passed parameters in a function
  4. Variables that are never used in the function

Answer: A

 

10) The C++ language is ______ object-oriented language.

  1. Pure Object-oriented
  2. Not Object-oriented
  3. Semi Object-oriented or Partial Object-oriented
  4. None of the above

Answer: C

Top articles
Difference between Java and C++ Published at:- C++ Interview Questions for Freshers and Experienced Published at:- C++ Quiz MCQ Question and Answer Published at:- C++ Quiz MCQ Question and Answer (Part 2) Published at:- What are the features of the C language Published at:-
R4Rin Team
The content on R4Rin.com website is created by expert teams.