Hello, im new to programming and I have an assignment where I can't get passed the while loop set up. I have the coding well enough to enter and store the first set of numbers but after that it ends the program. Using Dev-c++
These are the instructions:
1. You must use two different arrays, one for customer number, and one for sales. These are, in effect, parallel arrays.
2. You must use a "while" loop to gather customer number and sales. (I'm stuck here)
3. You must use a"for" loop to output the customer number and sales by customer.
Total number of customers I need to track is 4. Then the sales increase by 1000.
So basically to sum it up it looks like this
"How many customers do you want to track?" 4
"Enter the customer number." 1
"enter the sales for the customer" 1000
Program ends here with out me entering the rest of the information
Here is my code so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <stdio.h>
int printinfo
int addinfo(int cn, sales)
int main()
{
int customers, customerNumber, sales;
printf("How many customers do you want to track?");
scanf("%d", &tracker);
}
while (tracker=0; counter<
{ printf("Enter the customer number.");
scanf("%d", &cn);
printf("Enter the sales for the customer");
scanf("%d", &sales);
return 0;
}
|