#include #include using namespace std; int main() { cout << "Input the dividend: "; double dividend {0.0}; cin >> dividend; if (!cin) { cerr << "Sorry, that wasn't a valid number.\n"; return EXIT_FAILURE; } cout << "Input the divisor (can't be zero): "; double divisor {1.0}; cin >> divisor; if (!cin) { cerr << "Sorry, that wasn't a valid number.\n"; return EXIT_FAILURE; } if (divisor == 0) { //a double equal sign means "comparison" cerr << "Sorry, the divisor can't be zero.\n"; return EXIT_FAILURE; } cout << "The quotient is " << dividend / divisor << "\n"; return EXIT_SUCCESS; }