sarkanydavidhu

Switch Case

Apr 8th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. main()
  4. {
  5.      int  Grade = 'A';
  6.  
  7.      switch( Grade )
  8.      {
  9.         case 'A' : printf( "Excellent\n" );
  10.         case 'B' : printf( "Good\n" );
  11.         case 'C' : printf( "OK\n" );
  12.         case 'D' : printf( "Mmmmm....\n" );
  13.         case 'F' : printf( "You must do better than this\n" );    
  14.         default  : printf( "What is your grade anyway?\n" );
  15.      } 
  16. }
Advertisement
Add Comment
Please, Sign In to add comment