Advertisement
thenewboston

C Programming Tutorial - 22 - or

Aug 22nd, 2014
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     char answer;
  7.  
  8.     printf("Do you like bagels? (y/n) \n");
  9.     scanf(" %c", &answer);
  10.  
  11.     if( (answer=='y') || (answer=='n') ){
  12.         printf("I feel the same way");
  13.     }else{
  14.         printf("Keyboard much?");
  15.     }
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement