diff --git a/main.cpp b/main.cpp index 5411e7a..a74654c 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,9 @@ #include #include -using std::endl; -using std::cin; -using std::cout; +using endl; +using cin; +using cout; int main() { @@ -16,7 +16,11 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; + if (y == 0) { + cout << "Division: Dividing by 0 not a number (division by zero)" << endl; + } else { + cout << "Division: " << x / y << endl; + } cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl;