What is the output? int n = 2;
What is the output?
int n = 2;
switch (n) {
case 1: printf("A");
case 2: printf("B");
case 3: printf("C"); break;
default: printf("D");
}
Show answerHide answer
Correct answer: (D) BC
Explanation
Execution starts at case 2 and falls through to case 3 until break.