Switch case 4 : Multiple Choice Questions in C Programming
Problem Statement 4 : Is this program is Error free
void main()
{
int choice = 2 ;
switch(choice)
{
case 1 :
printf("nYour Time Starts now");
break;
case 7-8+3 :
printf("nWhy to Learn C Programming");
break;
case 9/3 :
printf("nDon't Use Pointer");
break;
}
}
Options :
- Yes
- No
Why ? Explanation :
- Constant Expression is absolutely allowed
- Variable included in Expression is not allowed as Constant Expression
- 7-8+3 = 2 so case 2 will be evaluated
- For more details ……
Select Switch Case Question :
