Find the error in the following program:

1.9 Find the error in the following program:
main( )
{
int m;
char g;
switch(m)
{
case 5 : grade=”P”;break;
case 2 : grade=”Q”;break;
case 2 : grade=”R”;break;
default : grade=”S”;break;
}
}
A) No two labels may be identical
B) switch statement cannot have more than three labels
C) case label cannot be numbers
D) none of the above


Leave a Reply