#include <iostream> using namespace std; int main() { int n1, n2, op; cout << "Type The First Number\n"; cin >> n1; cout << "Type The Second Number\n"; cin >> n2; cout << "Choose The Wanted Operation\n"; cout << "[1] +\n"; cout << "[2] -\n"; cout << "[3] /\n"; cout << "[4] *\n"; cin >> op; switch (op) { case 1: cout << n1 << " + " << n2 << " = " << n1 + n2 << "\n"; break; case 2: cout << n1 << " - " << n2 << " = " << n1 - n2 << "\n"; break; case 3: cout << n1 << " / " << n2 << " = " << n1 / n2 << "\n"; break; case 4: cout << n1 << " * " << n2 << " = " << n1 * n2 << "\n"; break; default: cout << "Operation Is Not Valid"; } return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter