Adm1n_0v3rride

Calcuator program v1.0

Sep 13th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.47 KB | None | 0 0
  1. //
  2. //
  3. //  Calcuator program v1.0
  4. //  (C) by Adm1n_0v3rride 2017
  5. //
  6. //
  7. #include <iostream>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     int first_number;
  14.     int secound_number;
  15.     int choice;
  16.     int sum; // sums up
  17.     int subtract; // Subtracts both numbers.
  18.     int multiply; // Multiply both numbers.
  19.     float divide; /* User has a choice of geting a float answer or a int answer. */
  20.     int modulo;
  21.    
  22.     cout << "Welcome to Calcuator program v1.0\n";
  23.    
  24.     cout << "Please enter a number: " << endl;
  25.     cin>>first_number;
  26.    
  27.     cout << "Please enter a secound number: " << endl;
  28.     cin>>secound_number;
  29.    
  30.     cout << "Please select which operation that you are doing \n1.addition\n2.subtraction\n3.multiplication\n4.division\n5.Modulus\n: " << endl;
  31.     cin>>choice;
  32.    
  33.     if(choice == 1)
  34.     {
  35.         sum = secound_number + first_number;
  36.         cout << "The sum is: "<<sum<<endl;
  37.     }
  38.     if(choice == 2)
  39.     {
  40.         subtract = secound_number - first_number;
  41.         cout << "The answer is: " <<subtract<<endl;
  42.     }
  43.     if(choice == 3)
  44.     {
  45.        multiply = secound_number * first_number;
  46.        cout << "The answer is: " <<multiply<<endl;
  47.     }
  48.     if(choice == 4)
  49.     {
  50.         divide = secound_number / first_number;
  51.         cout << "The answer is: "<<divide<<endl;
  52.     }
  53.     if(choice == 5)
  54.     {
  55.         modulo = secound_number % first_number;
  56.         cout << "The answer is: "<<modulo<<endl;
  57.     }
  58.     return 0;
  59. }
Add Comment
Please, Sign In to add comment