From 14cdd3e9a5e40eaac4eefd2feba6bf4355dcb6bb Mon Sep 17 00:00:00 2001 From: AdianTor Date: Mon, 2 Feb 2026 13:24:51 -0800 Subject: [PATCH] fixes errors --- main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a495fc94..d13fefbb 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,9 @@ #include #include +using std:: endl; +using std:: cout; +using std:: cin; int main() { std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; @@ -12,7 +15,15 @@ int main() std::cout << "Addition: " << x + y << std::endl; std::cout << "Subtraction: " << x - y << std::endl; std::cout << "Multiplication: " << x * y << std::endl; - std::cout << "Division: " << x / y << std::endl; + std::cout << "Division: " << x / y << std::endl; + if(y == 0 ) { + std::cout << "dividing by zero is not a number.\n"; + } + else{ + std::cout << "division" << x / y << std:: endl; + } + + std::cout << "Remainder: " << x % y << std::endl; std::cout << "Square Root: " << sqrt(x) << std::endl; std::cout << "Square: " << pow(x, y) << std::endl;