#include using namespace std; int main() { float a, b; char oper; cout << "Operandos: "; cin >> a >> b; do { cout << "Operacion ( +, -, *, / ): "; cin >> oper; if(oper!='+' && oper!='-' && oper!='*' && oper !='/') cout << "Operacion Incorrecta\n"; }while(oper!='+' && oper!='-' && oper!='*' && oper !='/'); if( oper == '/' ) for( ; !b; ) { cout << "No es posible la division entre 0\n"; cout << "Operando: "; cin >> b; } cout << a << " " << oper << " " << b << " = "; switch( oper ) { case '+': cout << a + b << "\n"; break; case '-': cout << a - b << "\n"; break; case '*': cout << a * b << "\n"; break; case '/': cout << a / b << "\n"; } cin.ignore(); cin.get(); return 0; }