d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > C Programing, Help With Add > ...
Add Reply New Topic New Poll
Member
Posts: 893
Joined: Nov 20 2008
Gold: 7,867.01
Jun 16 2012 09:39pm
hello,i need
help with a sells report program in C
im using a FOR in order to print the l price of the products im scanning
but afer taht i have to add up all the prices and show the total amount
help plz
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Jun 16 2012 09:42pm
double total = 0;

for (int i = 0; i < size; i++){
total += products[i].price;
}

assuming product is a struct

whats the problem?

This post was edited by carteblanche on Jun 16 2012 09:42pm
Member
Posts: 893
Joined: Nov 20 2008
Gold: 7,867.01
Jun 17 2012 11:13am
already had the for was missing the total, tyvm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll