As I said, see main().
Code:
void till(void)//function definition - used for the till selection
// here we add item name, quantity and price
{
puts("\nItems List\n"); //main till functions, select items, select quantity, select price
printf("Enter Item Name = "); //Item
scanf_s("%d",&item);
printf("Enter Quantity = "); //Quantity
scanf_s("%d",&quantity);
printf("Enter Price = "); //Price
scanf_s("%d",&price);
//this wonderfull code will add it all up for you
int multiply_stuff = quantity * price; //this deals with the total item price of whats been ordered.
//quantity multiplyed by price = total
printf("Product Name: %d :: Item Quantity: %d :: Item Price: = %d :: Total For Item: = %d ",item,quantity, price, multiply_stuff);
}
->
Code:
void till(void)//function definition - used for the till selection
// here we add item name, quantity and price
{
while(1) {
puts("\nItems List\n"); //main till functions, select items, select quantity, select price
printf("Enter Item Name = "); //Item
scanf_s("%d",&item);
if(item == 0) break;
printf("Enter Quantity = "); //Quantity
scanf_s("%d",&quantity);
printf("Enter Price = "); //Price
scanf_s("%d",&price);
//this wonderfull code will add it all up for you
int multiply_stuff = quantity * price; //this deals with the total item price of whats been ordered.
//quantity multiplyed by price = total
printf("Product Name: %d :: Item Quantity: %d :: Item Price: = %d :: Total For Item: = %d ",item,quantity, price, multiply_stuff);
}
}