C++ Quiz MCQ Question and Answer (Part 2)

Categories: C++ MCQ

C++ Quiz MCQ Question and Answer (Part 2)

 

1) Which of the following features is required to be supported by the programming language to become a pure object-oriented programming language?

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

Answer: D

 

2) Which of the following comment syntax is correct to create a single-line comment in the C++ program?

  1. //Comment
  2. /Comment/
  3. Comment//
  4. None of the above

Answer: A

 

3) C++ is a ___ type of language.

  1. High-level Language
  2. Low-level language
  3. Middle-level language
  4. None of the above

Answer: C

 

4) For inserting a new line in C++ program, which one of the following statements can be used?

  1. \n
  2. \r
  3. \a
  4. None of the above

Answer: A

 

5) Which one of the following represents the tab?

  1. \n
  2. \t
  3. \r
  4. None of the above

Answer: B

 

6) Which of the following refers to characteristics of an array?

  1. An array is a set of similar data items
  2. An array is a set of distinct data items
  3. An array can hold different types of datatypes
  4. None of the above

Answer: A

 

7) If we stored five elements or data items in an array, what will be the index address or the index number of the array's last data item?

  1. 3
  2. 5
  3. 4
  4. 88

Answer: C

 

8) Which of the following is the correct syntax for declaring the array?

  1. init array []
  2. int array [5];
  3. Array[5];
  4. None of the above

Answer: B

 

9) Which of the following is the correct syntax for printing the address of the first element?

  1. array[0];
  2. array[1];
  3. array[2];
  4. None of the above

Answer: A

 

10) Which of the following gives the 4th element of the array?

  1. Array[0];
  2. Array[0];
  3. Array[3];
  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.