Multiple Choice
What is the output of the following segment of code if the value 4 is input by the user?
int num;
int total = 0;
cout << "Enter a number from 1 to 10: ";
cin >> num;
switch (num)
{
case 1:
case 2:
total = 5;
case 3:
total = 10;
case 4:
total = total + 3;
Case 8:
total = total + 6;
default:
total = total + 4;
}
cout << total << endl;
A) 0
B) 3
C) 13
D) 23
E) None of these
Correct Answer:

Verified
Correct Answer:
Verified
Q14: What will be displayed after the
Q15: This operator represents the logical OR:<br>A) --<br>B)
Q16: After the following code executes, what
Q17: Which value can be entered to cause
Q18: What is the value of the following
Q20: When an if statement is placed within
Q21: What is the output of the following
Q22: This operator takes an operand and reverses
Q23: Input values should always be checked for<br>A)
Q24: Which line in the following program