-
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);
}
-
- No error, output is 2
- Compile time error, case label outside switch statement
- No error, output is 2222
- Compile time error, no break statements
- None of these
Correct Option: B
Compile time error, case label outside switch statement