/*Just an example of usage of switch
statement*/
#include <stdio.h>
#include <conio.h>
int main()
{
int x;
printf("Enter a number: ");
scanf("%d", &x);
switch(x)
{
case 1:
printf("good");
break;
case 2:
printf("fair");
break;
default:
printf("bad");
break;
}
getche();
return 0;
}
No comments:
Post a Comment