//1.
main()
{
int suite=1;
switch (suite);
{
case 0:
printf("\nClub");
case 1:
printf("\nDiamond");
}
}
//2.
main()
{
int temp;
scanf ("%d", &temp);
switch (temp)
{
case (temp<=20):
printf("\nOooooooohhhhh! Damn Cool!");
case (temp>20 && temp<=30):
printf("\nRain rain here again! ");
case (temp>30 && temp<=40):
printf("\nWish I am on Everest");
default:
printf("\nGood old nagpur weather");
}
}
//3.
main()
{
float a=3.5;
switch (a)
{
case 0.5:
printf("\nThe art of C");
break;
case 1.5:
printf("\nThe spirit of C");
break;
case 2.5:
printf("\nSee through C");
break;
case 3.5:
printf("Simply C");
}
}
//1)the error lies in the semicolon after the switch statement.
//2)This program cannot execute cuz a condition cannot be specified within a case
//statement.
//3)floating point numbers are not allowed in case statements.
The File can be downloaded at:
Download File
main()
{
int suite=1;
switch (suite);
{
case 0:
printf("\nClub");
case 1:
printf("\nDiamond");
}
}
//2.
main()
{
int temp;
scanf ("%d", &temp);
switch (temp)
{
case (temp<=20):
printf("\nOooooooohhhhh! Damn Cool!");
case (temp>20 && temp<=30):
printf("\nRain rain here again! ");
case (temp>30 && temp<=40):
printf("\nWish I am on Everest");
default:
printf("\nGood old nagpur weather");
}
}
//3.
main()
{
float a=3.5;
switch (a)
{
case 0.5:
printf("\nThe art of C");
break;
case 1.5:
printf("\nThe spirit of C");
break;
case 2.5:
printf("\nSee through C");
break;
case 3.5:
printf("Simply C");
}
}
//1)the error lies in the semicolon after the switch statement.
//2)This program cannot execute cuz a condition cannot be specified within a case
//statement.
//3)floating point numbers are not allowed in case statements.
The File can be downloaded at:
Download File
No comments:
Post a Comment
kiss on google ads if you are anonymous because your ip is trackable.thank you.
......from.admin