I'm testing this sample fast food chain program and my problem is every time I select the order the resulting price is like Php895764796364227741000000000000000.0000
Here's the code:
#include<stdio.h>
main()
{
int choice;
float TP;
clrscr();
printf("Welcome to Greenwich!\n\n");
printf("This is our menu:\n");
printf("1. Overloaded Pizzas\n");
printf("2. Extreme Cheese Overload\n");
printf("3. Classic Italian Pizza\n");
printf("4. Classic Favorites\n");
printf("5. Pastas\n");
printf("6. Chicken\n");
printf("7. Baked Rice Melt\n");
printf("8. Big Time Lucnch/ Snack Loads\n");
printf("\nPlease select a category:\n");
scanf("%d", &choice);
switch (choice)
{
case 1:
clrscr();
printf("OVERLOADED PIZZAS:\n\n");
printf("1. Greenwich Special Overload 18' Pizza Php%.2f\n", 749.00);
printf("2. Meat N' Cheese Overload Pizza Square Php%.2f\n", 501.00);
printf("3. Greenwich Special Overload Pizza Square Php%.2f\n", 501.00);
printf("4. Greenwich Special Overload Family Thin Php%.2f\n", 417.00);
printf("5. Greenwich Special Overload Double Thin Php%.2f\n", 248.00);
printf("6. Greenwich Special Overload Double Thick Rolled Edge Php%.2f\n", 292.00);
printf("7. Meat N' Cheese Overload Family Thin Php%.2f\n", 417.00);
printf("8. Meat N' Cheese Overload Family Thin Rolled Edge Php%.2f\n", 416.00);
printf("9. Meat N' Cheese Overload Double Thin Php%.2f\n", 248.00);
printf("10. Meat N' Cheese Overload Double Thick Rolled Edge Php%.2f\n", 292.00);
printf("11. Fantastic G4 Php%.2f\n", 749.00);
printf("12. Sqauare Half and Half Php%.2f\n", 501.00 );
printf("13. 7-Cheese Overload Php%.2f\n",229.00);
printf("14. Hawaiin Overload Php%.2f\n", 199.00);
printf("15. Meat N' Cheese Overload Php%.2f\n", 349.00);
printf("\nMay I take your order?\n");
scanf("%d", &choice);
printf("\nYour bill is Php%f", TP);
getch();
break;
case 2:
break;
}
getch();
}
hope someone could help me