I am a very beginner in c++. i am just learning abc of this language.. i created this small program that would add:
#include
using namesp
You can try putting the main part of your 'adding' in an endless loop. I suggest use a post condition loop, meaning one that will execute it's body at least once (then it will check the condition and so on), because you'll be wanting to add some numbers at least once.
Example:
do {
// do stuff here
} while (true) // always true condition -> makes the loop infinite
So I guess you'll ask how do you stop this. You can ask the user if he wants to continue. Add this to the loop's body:
int lock = 0;
cout << "Do you want to continue? (0 = no, 1 = yes)" << endl;
cin << lock;
if (lock == 0) break; // stops the loop immeadiately
You can do the same with lock being char with values 'y' or 'n'.