if you already know that how to add two given numbers in C++, we can then modify the program to add two given numbers several times. Generally we compile and run a C++ program by pressing CTRL+F9 key in case of TC (Turbo C++). if you don't have a Turbo compiler then Download Turboc C++ 3.0.
Generally The program runs only one set of data means program takes value of a and value of b then gives addition of c as output. If we would like to add more values we need to run/execute the program again. To overcome this problem the program below, adds two numbers several times until you give 0 (zero) value for a.
Here is the program :
Here in the above program for loop is used to make the condition to take several data until 0 value of "a" variable is entered. The above program can be used to add two numbers many times.