1234567891011121314151617181920212223242526272829303132333435
# include <iostream> using namespace std; int main() { char operation; float num1,num2; cout << "Enter operator either + or - or * or /: "; cin >> operation; cout << "Enter first operand: "; cin >> num1; cout << "Enter second operand: "; cin >> num2; switch(operation) { case '+': cout << num1+num2; break; case '-': cout << num1-num2; break; case '*': cout << num1*num2; break; case '/': cout << num1/num2; break; default: cout << "Error! operator is not correct"; break; } cout << endl; return 0; }