From b53b538ffc5bc7debe8f25308358a3a0f69942a7 Mon Sep 17 00:00:00 2001 From: Parker Close Date: Mon, 31 Aug 2026 12:30:23 -0700 Subject: [PATCH] User input now int32_t. resolves #340 --- main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 5411e7a3..b02a419d 100644 --- a/main.cpp +++ b/main.cpp @@ -8,11 +8,14 @@ using std::cout; int main() { cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - cout << "Hi, please enter two whole numbers: "; + cout << "Hi, please enter two whole numbers (Limited to whole numbers between -2,147,483,648 and 2,147,483,647): "; - int x,y; + int32_t x,y; - cin >> x >> y; + cin >> x; + cin.clear(); // clear input buffer in case user inputs value outside of expected range + cin >> y; + cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl;