#include #include #include using namespace std; int main() { char cexpr[256]; double opnd1, opnd2; char op; cout << "Enter arithmetic expression: "; cin.getline(cexpr, 256); istringstream sstream(cexpr); sstream >> opnd1 >> op >> opnd2; double result=0; switch(op) { case '+': result = opnd1 + opnd2; break; case '-': result = opnd1 - opnd2; break; case '*': result = opnd1 * opnd2; break; case '/': result = opnd1 / opnd2; break; default: cout << "ERROR\n"; break; } cout << result << endl; }