Learn C++ MCQs
Prepare C++ MCQs (Multiple choice Questions) for exam and job interviews.
What is the output of cout << (7 + 3 * 2) << endl;
1) 13
2) 10
3) 17
4) None of the above
Answer : 13
What is the correct way to define a reference in C++?
1) int& ref;
2) int *ref;
3) int ref;
4) None of the above
Answer : int& ref;
Which of the following is used to allocate an array dynamically in C++?
1) new
2) malloc()
3) calloc()
4) Both 1 and 2
Answer : new