From 4db6f717d391ce50305762595be963958ed240a6 Mon Sep 17 00:00:00 2001 From: HBrough-6 Date: Mon, 8 Sep 2025 11:27:06 -0700 Subject: [PATCH] handleNaN closes, #61 --- main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 958ba61..269cedc 100644 --- a/main.cpp +++ b/main.cpp @@ -15,7 +15,14 @@ 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 << "Dividing by zero is not a number." << end; + } + else + { + cout << "Division: " << x / y << endl; + } cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl;