Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This program sums two numbers
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <string>
- using namespace std;
- int main()
- {
- int user1= 0;
- int user2= 0;
- int sum= 0;
- int choice=0;
- do
- {
- cout<< "Please enter 2 numbers an i will "
- "add them together"<<endl;
- cin>>(user1);cin>>(user2);
- sum=user1+user2;
- cout<< "The sum is "<<sum<<endl;
- cout<<endl;
- cout<< "Would you like to do it again? (1 for yes, 0 for no)"<<endl;
- cin>>(choice);
- cout<<endl;
- }while(choice==1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement