Point out the error, if any in the following program.

		
					

Loading

โœช Choose the correct option.

Point out the error, if any in the following program.

#include  
int main() {
int P = 10;
switch(P) {
case 10:
printf("Case 1");
case 20:
printf("Case 2");
break;
case P:
printf("Case 2");
break;
}
return 0;
}

A. Error: No default value is specified
B. error: case label does not reduce to an integer constant
C. Error: There is no break statement in each case.
D. No error will be reported.

Leave a Comment