Answer:
Check explanation
Explanation:
# include <iostream>
using namespace std;
int main()
{
char op;
float a, b;
cout << "Enter operator either + or - or * or /: ";
cin >> op;
cout << "Enter two operands: ";
cin >> num1 >> num2;
switch(op)
{
case '+':
cout << a + b;
break;
case '-':
cout << a - b;
break;
case '*':
cout << a * b;
break;
case '/':
cout << a / b;
break;
default:
cout << "This operator is not valid. Please try again.";
break;
}
return 0;
}