#include <iostream.h>
int main(void){
int a;
int b;
int c;
cin >> a;
cin >> b;
c = a+b;
cout << c;
return 0;
}
I am trying to create an "addition machine". As of now, after I run the program, I can input a number and then another number, and it gives me the sum. If I input 10 and a 12, it automatically adds it up to 22. The problem is that I can't do more than 1 sum like that. I want to make it go continuously. I want it so I can input 10 and 12 and get 22 and input 15 to get 37 and 13 to get 50. I want it to terminate when I type in 0 or something not a letter. My problems with these type of programs are:
1. I don't know how to make them continue after 1 input.
2. I don't know how to choose when they terminate.
I am very knew at programming, and I need help. If you choose to, you can give me examples of the same concept, so I can apply the knowledge to this. The problem is I never did anything near this and my textbook doesn't even show how to make the input thing continue.