From 42814214a17285ee97ad91d28a00ce1d511b71cd Mon Sep 17 00:00:00 2001 From: big-al188 Date: Thu, 12 Sep 2024 19:25:32 -0700 Subject: [PATCH] Added Division closes #2 --- main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 47b917d..8157182 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,11 @@ int main(){ cout<< (first-second) << endl; cout<< "Multiplication: "<< first << "*" << second << "="; cout<< (first*second) << endl; - + if (second != 0) { + cout<< "Division: "<< first << "/" << second << "="; + cout<< (first/second) << endl; + } else { + cout<< "Division: Error - cannot divide by zero!" << endl; + } return 0; -} \ No newline at end of file +}