John Calcu
John Calcu
John Calcu
#include <limits>
using namespace std;
int main() {
char op;
float num1, num2;
char again;
do {
cout << "Enter an operator (+, -, *, /): ";
cin >> op;
switch (op) {
case '+':
cout << "The sum of " << num1 << " and " << num2 << " is: " << num1
+ num2 << endl;
break;
case '-':
cout << "The difference of " << num1 << " and " << num2 << " is: "
<< num1 - num2 << endl;
break;
case '*':
cout << "The product of " << num1 << " and " << num2 << " is: " <<
num1 * num2 << endl;
break;
case '/':
if (num2 != 0) {
cout << "The quotient of " << num1 << " and " << num2 << " is:
" << num1 / num2 << endl;
} else {
cout << "ERROR 404!!!! (divided by zero is undefined/impossible
dummy!) >:(" << endl;
}
break;
}
return 0;
}
1373, 16839,17096