Q:
Point out the error, if any, in the following program.
main()
{
int i = 4, j = 2;
switch(i)
{
case 1 :
printf (''\n To err is human, to forgive is against company policy.");
break;
case j :
printf (''\n if you have nothing to do, don't do it here.");
break;
}
}
Answer
Constant expression required in the second case, we cannot use j.
View answer
Workspace
Report Error
Discuss