Write a progam in C (WAPIC) Using switch ............. case
Write a progam in C (WAPIC) Using switch ............. case statement to examine the value of TRY.
print GOOD if TRY has value 10,
print VERY GOOD if TRY has value 15,
print BEST if TRY has value 25,
print BAD if TRY as any other values.
For eg :-
Output :-
Enter the value of TRY
25
BEST
print GOOD if TRY has value 10,
print VERY GOOD if TRY has value 15,
print BEST if TRY has value 25,
print BAD if TRY as any other values.
#include< #include< #include< void main() { int TRY; printf(" Enter the value of TRY \n"); scanf("%d", &TRY); switch(TRY) { case 10 : printf("\n GOOD \n"); break; case 15 : printf("\n VERY GOOD \n"); break; case 25 : printf("\n BEST \n"); break; default : printf("\n BAD \n"); } } |
---|
For eg :-
Output :-
Enter the value of TRY
25
BEST
0 comments:
Post a Comment