Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a,sum;
- int b=0, p=0,s=0;
- printf("Welcome to KKCB\nThe Menu available menu is : \n");
- printf("(1)Food Name: Burgar\n\tPrize: 100 Taka \n\n");
- printf("(2)Food Name: Pizza \n\tPrize: 300 taka \n\n");
- printf("(3)Food Name: Set Menu\n\tPrize: 250 taka\n\n(4)Check Total \n\n");
- printf("Enter the Food code (Situated beside the food name in bracket)");
- selection:
- printf("\nSelect your food : ");
- scanf("%d",&a);
- switch (a){
- case 1:
- b++;
- goto selection;
- break;
- case 2:
- p++;
- goto selection;
- break;
- case 3:
- s++;
- goto selection;
- break;
- case 4:
- printf("\nTotal Food Items : \n\n");
- if(b!=0)
- printf("\tBurger [%d] - %d Taka\n",b,b*100);
- if(p!=0)
- printf("\tPizza [%d] - %d Taka\n",p,p*300);
- if(s!=0)
- printf("\tSet Menu [%d] - %d Taka\n",s,s*250);
- sum=(b*100)+(p*300)+(s*250);
- printf("\nTotal Price : %d \n",sum);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement