Hi,
Does any1 here know how find out the sum of number?
Example: given number 5
i want to find out the sum of 5
1+2+3+4+5=15
how can i get it done?
sorry, am not able to put it in words properly.
Thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SolitairePosted May 29, 2006, 8:22 PM
Accumulate the value of the counter variable to the total inside the loop:
inum = inum + i
Suneel KumarPosted May 29, 2006, 3:40 PM
where n is the number for which u want to find the sum.
is this what u r expecting?