From 8ef5ad63e3e4f441c73ef7a5753e1190c69609a5 Mon Sep 17 00:00:00 2001 From: Kevin Buffardi Date: Tue, 1 Sep 2026 21:44:06 -0700 Subject: [PATCH] feat: calculate division as a decimal quotient, close #431 --- main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 5411e7a3..b58cad9f 100644 --- a/main.cpp +++ b/main.cpp @@ -10,13 +10,16 @@ int main() cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; cout << "Hi, please enter two whole numbers: "; - int x,y; + int x; + int y; + double quotient; cin >> x >> y; + quotient = x/(y*1.0); cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; + cout << "Division: " << quotient << endl; cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl;