Guest User

Untitled

a guest
Jan 19th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.     char str[3];
  7.     char str1[9];
  8.    
  9.     printf("Hello! Are you Sean?\n");
  10.     scanf("%s",&str);
  11.     int res = strncmp(str, "yes?", 3);
  12.     if(res == 0)
  13.     {
  14.         printf("Welcome back! It's good to see you again.\n");
  15.         printf("How is the weather out there?\n");
  16.         scanf("%s",&str1);
  17.         int res=strncmp(str1, "good?",9);
  18.         if(res==0)
  19.         {
  20.             printf("Glad to hear it! Have a nice, sunny day!\n");
  21.         }
  22.         else if(res==1)
  23.         {
  24.             printf("Oh. Well, let me know when he gets back.\n");
  25.         }
  26.     }
  27.     else if(res==1)
  28.     {
  29.         printf("Darn it. Well, maybe tomorrow then!");
  30.     }
  31.     return(0);
  32. }
Add Comment
Please, Sign In to add comment