Advertisement
GreenMs02

Untitled

Mar 7th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. SetConsoleTitle("Simple Calculator");
  2.     int firstvalue, secondvalue, choose;
  3.     printf("Enter 1st value \n");
  4.     cin >> firstvalue;
  5.     printf("Enter 2st value \n");
  6.     cin >> secondvalue;
  7.     printf("-------------------------- \n");
  8.     printf("Select Operator to use:\n");
  9.     printf("1.] Add it\n");
  10.     printf("2.] Subtract it\n");
  11.     printf("3.] Multiply it\n");
  12.     printf("4.] Divide it\n");
  13.     cin >> choose;
  14.     switch (choose)
  15.     {
  16.     case 1:
  17.         cout << "Equals = " << firstvalue + secondvalue << endl;
  18.         break;
  19.     case 2:
  20.         cout << "Equals = " << firstvalue - secondvalue << endl;
  21.         break;
  22.     case 3:
  23.         cout << "Equals = " << firstvalue * secondvalue << endl;
  24.         break;
  25.     case 4:
  26.         cout << "Equals = " << firstvalue / secondvalue << endl;
  27.         break;
  28.     default:
  29.         break;
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement