C++ MCQ Questions and Answers
C++ MCQ questions and answers are vital for students preparing for software development and IT placement exams like TCS, Infosys, and Tech Mahindra. These questions test your understanding of core concepts such as classes, objects, inheritance, polymorphism, and templates. Practicing C++ programming MCQs with detailed explanations helps strengthen coding logic and syntax understanding. This topic is ideal for candidates aiming to improve their performance in programming interview questions with answers and campus recruitment tests.
C++ MCQ
Showing 10 of
93 questions
52. When requesting multiple datum, user must separate each by using
- a space
- a tab character
- a new line character
- all of above
53. cin extraction stops execution as soon as it finds any blank space character
- TRUE
- FALSE
54. Observe the following statements and decide what do they do. string mystring; getline(cin, mystring);
- reads a line of string from cin into mystring
- reads a line of string from mystring into cin
- cin can’t be used this way
- none of above
55. Regarding stringstream identify the invalid statement
- stringstream is defined in the header file <sstream>
- It allows string based objects treated as stream
- It is especially useful to convert strings to numerical values and vice versa.
- None of above
56. Which of the header file must be included to use stringstream?
- <iostream>
- <string>
- <sstring>
- <sstream>
57. Which of the following header file does not exist?
- <iostream>
- <string>
- <sstring>
- <sstream>
58. If you use same variable for two getline statements
- Both the inputs are stored in that variable
- The second input overwrites the first one
- The second input attempt fails since the variable already got its value
- You can not use same variable for two getline statements
59. The "return 0;" statement in main function indicates
- The program did nothing; completed 0 tasks
- The program worked as expected without any errors during its execution
- not to end the program yet.
- None of above
60. Which of the following is not a reserve keyword in C++?
- mutable
- default
- readable
- volatile