☰
d2jsp
Rules
Help
Forum Gold FAQ
Live Streams
Photo Gallery
Hourly Raffle
Ladder Slasher
Log In
Register
Log In
Register
Account Recovery
Resend Validation Email
d2jsp Forums
>
Off-Topic
>
Computers & IT
>
Programming & Development
> C Programing, Help With Add > ...
Add Reply
New Topic
New Poll
Views: 289
Replies: 2
Track Topic
Lpal
Member
Posts: 893
Joined: Nov 20 2008
Gold
:
7,867.01
#1
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
carteblanche
Member
Posts: 32,925
Joined: Jul 23 2006
Gold
:
3,804.50
#2
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
Lpal
Member
Posts: 893
Joined: Nov 20 2008
Gold
:
7,867.01
#3
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
© 2003-2026 d2jsp
Contact