Join ExamsbookAnswer :
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;
}
}5
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; } }
- Show AnswerHide Answer
- Workspace
Answer :
Explanation :
Constant expression required in the second case, we cannot use j.



