Hello, i just started to study c++ and i have a problem about 1 porgram in the homework !
it ask me to write a c++ program that first asks the user if he want to enter a number if yes he enters the number and then ask him again if he wants enter another number if he sayed yes again he enters the number and so on till he press say No and the display number is the sum of all the numbers he entered !

5 Years
Discussion Span
Last Post by deceptikon

Keep a running sum of the numbers, that way you can keep a single variable for the currently entered number and reuse it in a loop.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.