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 !

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.