Long Quiz 01 19 23
Long Quiz 01 19 23
Long Quiz 01 19 23
A. 4
B. 3
C. 5
D. 6
if (0) {
cout << "Hello" ;
}
else
{
cout << "Goodbye" ;
}
return 0;
}
A. Hello
B. Goodbye
C. HelloGood bye
D. Compilation Error
4. if you must make decision based on multiple choices, which of the following is best suited?
A. If
B. if-else
C. if-else-if
D. All the above
E.
5. Can we use string inside switch statement?
A. Yes
B. No
6. In situations where we need to execute body of the loop before testing the condition, we should use_____.
A. For loop
B. While loop
C. Do-while loop
D. Nested for loop
9. What is the way to suddenly come out of or quit any loop in C++?
A. continue; statement
B. break; statement
C. leave; statement
D. quit; statement
20. A switch construct can be used with which of the following types of variables?
A. Int
B. int, char
C. int, float, char
D. Any basic datatype
21. The destination statement for the goto label is identified by what label?
A. $
B. @
C. *
D. :
return 0;
}
A. 1010
B. 10
C. infinitely print 10
D. compile time error