Advertisement
YTTB

nae nae

Dec 14th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. //This program sums two numbers
  2.  
  3. #include <iostream>
  4. #include <iomanip>
  5. #include  <cmath>
  6. #include <string>
  7.  
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.   int user1= 0;
  14.   int user2= 0;
  15.   int sum=   0;
  16.   int choice=0;
  17.  
  18.  
  19.   do
  20.   {
  21.   cout<< "Please enter 2 numbers an i will "
  22.   "add them together"<<endl;
  23.   cin>>(user1);cin>>(user2);
  24.  
  25.   sum=user1+user2;
  26.  
  27.   cout<< "The sum is "<<sum<<endl;
  28.   cout<<endl;
  29.  
  30.   cout<< "Would you like to do it again? (1 for yes, 0 for no)"<<endl;
  31.   cin>>(choice);
  32.   cout<<endl;
  33.  
  34.   }while(choice==1);
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement