Kindly help me to figure out the solution for this problem...The compiler isn't showing any error or warning still the program is not working properly..... Here is the code for this program. This program was made to calculate the fast food bill using switches...
#include
void main()
{ int choice , total = 0,x ; int ffood;
printf("\t\t\t\tWELCOME TO KFC\n\n"); printf("\t\t\t\tMAIN MENU\n\n"); printf("\t\t\tPress 1 for fast food menu\n"); printf("\t\t\tPress 2 to quit\n "); scanf("%d",&choice);
switch (choice)
{ case 1: printf("\t\t\tPLEASE GIVE YOU CHOICE\n\n"); printf("Press 4 for shami burgers = 100RS\n"); printf("Press 5 for chicken pizza = 700RS\n"); printf("Press 6 for drinks = 10RS\n"); printf("Press 2 to exit"); scanf("%c",&ffood);
switch (ffood) { case 4: total = total + 100; printf("\t\t\t\nYou have bought a shami burger worth 100RS.Your current bill is %d", total); break;
case 5: total = total + 700; printf("\t\t\t\nYou have bought a chicken pizza worth 700RS.Your current bill is %d", total); break;
case 6: total = total + 10; printf("\t\t\t\nYou have bought a soft drink worth 10RS.Your current bill is %d", total); break;