using loops to compare pizza prices
I am trying to write a program that prompts the user to enter different pizza size combinations for easy comparison. The program will decipher which pizzeria offers the cheapest pizza per square inch. The problem is, we do not know how many offers there are each night. one night, we could have 4 deals...next night we could have 5 deals...I was thinking of using loops to let the user decide how many deals there are to enter. how do I do that?
so I got this. which will work but I do not know how to go on from there..
insert
Code:
int i, num_deals;
/* do something here to read a number of deals */
printf("Enter th4e number of deals\n");
scanf("%d",num_deals);
for (i=1; i <= num_deals; i++) {
/* handle deal number i here */
}
should I use an array? if so, how do you get started on that? I have no idea how to link the information the loop statement reads into an array...and have the array tell me which one of the answers is the lowest number so it can spit it out to the user and tell them which one is cheap...
i probably will have to use strings so the user can tell which pizzaria specifically the deals are the cheapest rather than base them on numbers.....
please help! thank you.