Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- int num1, num2;
- char opr;
- cout << "I want you to put two integers, GO WILD!! ^_^: ALL RIGHTS RESERVERD @ JUNZYSTARZ 8):";
- cin >> num1 >> num2;
- cout << endl;
- cout << "Enter operator symbol: + (ADD), - (SUBTRACT)," << " * (MULTIPLY), / (DIVIDE): ";
- cin >> opr;
- cout << endl;
- cout << num1 << " " << opr << " " << num2 << " = ";
- switch (opr) {
- case '+':
- cout << num1 + num2 << endl;
- break;
- case'-':
- cout << num1 - num2 << endl;
- break;
- case'*':
- cout << num1 * num2 << endl;
- break;
- case'/':
- if (num2 != 0)
- cout << num1 / num2 << endl;
- else
- cout << "ERROR \nCannot divide by zero" << endl;
- break;
- default:
- cout << "Illegal operation" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement