Advertisement
Aminpro

[ECP 1016]Switch program

Jul 1st, 2012
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2.  
  3. #include <stdio.h>
  4.  
  5. int main(void)
  6. {
  7.          char yesno;
  8.          scanf("%c", &yesno);
  9.          switch(yesno){
  10.                        case('y'):
  11.                                  printf("Yes.");
  12.                                  break;
  13.                        case('Y'):
  14.                                  printf("Yes.");
  15.                                  break;
  16.                        case('n'):
  17.                                  printf("No.");
  18.                                  break;
  19.                        case('N'):
  20.                                  printf("No.");
  21.                                  break;
  22.                        default:
  23.                                  printf("Nither Yes nor No");
  24.                                  
  25.                        break;
  26.                        
  27.                        }
  28.                        
  29.          getchar();
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement