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?
- Encapsulation
 - Inheritance
 - Polymorphism
 - 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?
- //Comment
 - /Comment/
 - Comment//
 - None of the above
 
Answer: A
3) C++ is a ___ type of language.
- High-level Language
 - Low-level language
 - Middle-level language
 - None of the above
 
Answer: C
4) For inserting a new line in C++ program, which one of the following statements can be used?
- \n
 - \r
 - \a
 - None of the above
 
Answer: A
5) Which one of the following represents the tab?
- \n
 - \t
 - \r
 - None of the above
 
Answer: B
6) Which of the following refers to characteristics of an array?
- An array is a set of similar data items
 - An array is a set of distinct data items
 - An array can hold different types of datatypes
 - 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?
- 3
 - 5
 - 4
 - 88
 
Answer: C
8) Which of the following is the correct syntax for declaring the array?
- init array []
 - int array [5];
 - Array[5];
 - None of the above
 
Answer: B
9) Which of the following is the correct syntax for printing the address of the first element?
- array[0];
 - array[1];
 - array[2];
 - None of the above
 
Answer: A
10) Which of the following gives the 4th element of the array?
- Array[0];
 - Array[0];
 - Array[3];
 - None of the above
 
Answer: C