diff --git a/main.cpp b/main.cpp old mode 100644 new mode 100755 index 5411e7a3..b6b20c47 --- a/main.cpp +++ b/main.cpp @@ -16,8 +16,18 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; + if (y == 0) + { + cout << "Diving by zero is not a number." << endl; + } + else + { + cout << "Division: " << x / y << endl; + cout << "Remainder: " << x % y << endl; + } + + //cout << "Division: " << x / y << endl; + //cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl;