New Simple Calculator
Sun Sep 17 2023 07:29:01 GMT+0000 (Coordinated Universal Time)
Saved by
@akaeyad
#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;
}
content_copyCOPY
Comments