Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #include <stdlib.h>
  4.  
  5.  
  6.  
  7. //gn= guest number, l= length, s= smoker, ccn= credit card number
  8.  
  9.  
  10.  
  11. int main()
  12.  
  13. {
  14.  
  15. int gn, l, ccn, i, s, cnt;
  16. char Name[60];
  17.  
  18. printf("Enter Guest Number \n");
  19.  
  20. scanf("%d", gn);
  21.  
  22. while(gn != -1)
  23.  
  24. {
  25.  
  26.     printf("Please Enter Name \n");
  27.  
  28.     scanf("%s", Name);
  29.  
  30.     printf("Enter length of stay \n");
  31.  
  32.     scanf("%d", l);
  33.  
  34.     if (l > 7)
  35.  
  36.     {
  37.  
  38.         printf("You can only stay for 7 days \n");
  39.  
  40.         printf("Enter length of stay");
  41.  
  42.         scanf("%d", l);
  43.  
  44.     }
  45.  
  46.    
  47.  
  48.     printf("If you smoke please enter 1 \n");
  49.  
  50.     scanf("%d", s);
  51.  
  52.     if(s = 1)
  53.  
  54.     {
  55.  
  56.         printf("Smoker.");
  57.  
  58.     }
  59.  
  60.     else
  61.  
  62.     {
  63.  
  64.         printf("Non-Smoker");
  65.  
  66.     }
  67.  
  68.  
  69.  
  70. }
  71.  
  72. return 0;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement