Advertisement
Ed94

Addition Program

May 13th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. //This is an addition calculator that adds two values choosen by the user.
  2. #include <iostream>
  3.  
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()// All instructions encapsulated inside main.
  9.     {
  10.     cout << "Addition Calulator initiated \n"; // Verify's program has started correctly.
  11.     cout << "\n";
  12.  
  13.  
  14.     //Declaring the variables
  15.     int x;
  16.     int y;
  17.  
  18.  
  19.     // Method to add a number with values chosen by the user.
  20.     cout << "Choose the first number: "; cin >> x;
  21.     cout << "\n";
  22.  
  23.     cout << "Value Entered:" << x;
  24.     cout << "\n";
  25.  
  26.     cout << "\n";
  27.     cout << "Choose the second Number: "; cin >> y;
  28.     cout << "\n";
  29.  
  30.     cout << "Value Entered:" << y;
  31.     cout << "\n";
  32.  
  33.     cout << "\n";
  34.     cout << "Solution for addition: "; cout << x + y << endl;
  35.  
  36.  
  37.     cin.get();
  38.     return 0;
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement