Switch case 4 : Multiple Choice Questions in C Programming

January 26, 2025 No Comments » Hits : 185





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 :
  1. Yes
  2. No



Why ? Explanation  :
  1. Constant Expression is absolutely allowed
  2. Variable included in Expression is not allowed as Constant Expression
  3. 7-8+3 = 2 so case 2  will be evaluated
  4. For more details ……

Select Switch Case Question :

Bookmark & Share