1.

Comment on the output of the following C code.
 #include <stdio.h>
int main()
{
int num = 2;
switch (num)
case 1:
printf("%d", num);
case 2:
printf("%d", num);
case 3:
printf("%d", num);
default:
printf("%d", num);
}

A. No error, output is 2
B. Compile time error, case label outside switch statement
C. No error, output is 2222
D. Compile time error, no break statements
E. None of these
Answer» C. No error, output is 2222


Discussion

No Comment Found

Related MCQs