dsdeep

code 1

Aug 21st, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.85 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int n,input,b=0,c=0,p=0,f=0,count=1;
  6. again:
  7.     printf("Food Items :\n\t1 . Burger - 120 TK - 1\n\t2 . Fried Chicken - 90 TK - 1\n\t3 . Pizza - 300 TK - 1\n\t4 . French Fries - 60 TK - 1\nChoose One : ");
  8.     scanf("%d",&n);
  9.     if(n==1)
  10.     {
  11.         b++;
  12.         printf("\tPress 0 To Go To Buy Again\n\tPress 1 To Checkout : ");
  13.         scanf("%d",&input);
  14.         if(input==0)
  15.             goto again;
  16.         else
  17.             goto checkout;
  18.     }
  19.     else if(n==2)
  20.     {
  21.         c++;
  22.         printf("\tPress 0 To Go To Buy Again\n\tPress 1 To Checkout : ");
  23.         scanf("%d",&input);
  24.         if(input==0)
  25.             goto again;
  26.         else
  27.             goto checkout;
  28.     }
  29.              else if(n==3)
  30.     {
  31.         p++;
  32.         printf("\tPress 0 To Go To Buy Again\n\tPress 1 To Checkout : ");
  33.         scanf("%d",&input);
  34.         if(input==0)
  35.             goto again;
  36.         else
  37.             goto checkout;
  38.     }
  39.              else if(n==4)
  40.     {
  41.         f++;
  42.         printf("\tPress 0 To Go To Buy Again\n\tPress 1 To Checkout :  ");
  43.         scanf("%d",&input);
  44.         if(input==0)
  45.             goto again;
  46.         else
  47.             goto checkout;
  48.     }
  49.  
  50.  
  51. checkout:
  52.         printf("\nItem List :\n");
  53.         if(b!=0)
  54.         {
  55.         printf("\t%d . Burger - %d - %d\n",count,120*b,b);
  56.         count++;
  57.         }
  58.         if(c!=0)
  59.         {
  60.             printf("\t%d . Fried Chicken - %d - %d\n",count,90*c,c);
  61.             count++;
  62.         }
  63.                 if(p!=0)
  64.         {
  65.             printf("\t%d . Pizza - %d - %d\n",count,300*p,p);
  66.             count++;
  67.         }
  68.         if(f!=0)
  69.         {
  70.             printf("\t%d . French Fry - %d - %d\n",count,60*f,f);
  71.         }
  72.         printf("\n\tTotal Bill : %d Taka\n",(120*b)+(90*c)+(300*p)+(60*f));
  73.  
  74.         return 0;
  75.     }
  76.  
Advertisement
Add Comment
Please, Sign In to add comment