Multiple Choice
What is wrong with the following switch statement?
Int ans;
Cout <<"Type y for yes on n for no\n";
Cin >> ans;
Switch ans)
{
Case 'y':
Case 'Y': cout << "You said yes\n"; break;
Case 'n':
Case 'N': cout << "You said no\n"; break;
Default: cout <<"invalid answer\n";
}
A) ans is a int
B) break; is illegal syntax
C) nothing
D) there are no break statements on 2 cases.
Correct Answer:

Verified
Correct Answer:
Verified
Q8: Which boolean operation is described by the
Q9: Variables defined inside a set of braces
Q10: The break statement causes all loops to
Q11: Given the following enumerated data type definition,
Q12: The compiler always pairs an else with
Q14: Which boolean operation is described by the
Q15: Which of the following symbols has the
Q16: What is the output of the following
Q17: _ is a type whose values are
Q18: Which of the following is not a