From 126c27976dbe4c109f2f94b528a6eb8dd4f90623 Mon Sep 17 00:00:00 2001 From: Joshua Gonzalez Date: Wed, 10 Sep 2025 15:20:09 -0700 Subject: [PATCH] Made condition based on division operation --- main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a495fc9..9c2709a 100644 --- a/main.cpp +++ b/main.cpp @@ -12,7 +12,11 @@ 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; + if(y != 0){ + std::cout << "Division: " << x / y << std::endl; + }else{ + std::cout << "Dividing by a 0 is not possible" <