Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetConsoleTitle("Simple Calculator");
- int firstvalue, secondvalue, choose;
- printf("Enter 1st value \n");
- cin >> firstvalue;
- printf("Enter 2st value \n");
- cin >> secondvalue;
- printf("-------------------------- \n");
- printf("Select Operator to use:\n");
- printf("1.] Add it\n");
- printf("2.] Subtract it\n");
- printf("3.] Multiply it\n");
- printf("4.] Divide it\n");
- cin >> choose;
- switch (choose)
- {
- case 1:
- cout << "Equals = " << firstvalue + secondvalue << endl;
- break;
- case 2:
- cout << "Equals = " << firstvalue - secondvalue << endl;
- break;
- case 3:
- cout << "Equals = " << firstvalue * secondvalue << endl;
- break;
- case 4:
- cout << "Equals = " << firstvalue / secondvalue << endl;
- break;
- default:
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement