Friday, 19 September 2014

WAP to use Switch case.

#include<stdio.h>
#include<conio.h>
main()
{
   clrscr();
   int a;
   scanf("%d",&a);
   switch( a )
     {
case 1 : printf( "Excellent\n" );
  break;
case 2 : printf( "Good\n" );
  break;
case 3 : printf( "OK\n" );
  break;
case 4 : printf( "Mmmmm....\n" );
  break;
case 5 : printf( "You must do better than this\n" );
  break;
default  : printf( "What is your grade anyway?\n" );
  break;
     }
}

No comments:

Post a Comment

Please write your doubts