0
how we can add two number in a loop
3 Answers
+ 8
First you need to know which loop you want to use, there are difference between them. Now about the "how", there are different ways to add numbers using loop, a simple one would be to use two variables, e.g. "n" and "sum" both initialized to zero, in your loop body you get user input into "n" then add that number to "sum", then after the loop you output "sum" to screen, this way you can actually add as many numbers as your loop was designed to repeat.
Hth, cmiiw
+ 7
You're welcome : )
+ 1
thanku