From d081ad4c1cf2fa866a86ad8116e37e46162d82ad Mon Sep 17 00:00:00 2001 From: Arnav Date: Tue, 9 Sep 2025 17:33:14 -0700 Subject: [PATCH 1/4] replacing with namespace std --- main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 958ba61..2441321 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,8 @@ #include #include -using std::cin; -using std::cout; -using std::endl; +using namespace std; + int main() { @@ -12,7 +11,7 @@ int main() int x,y; cin >> x >> y; - cout << "Addition: " << x + y << endl; + cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; cout << "Division: " << x / y << endl; From cbae219e48963e7d8f4c3a7a77f84e0f4e70832c Mon Sep 17 00:00:00 2001 From: Arnav Date: Tue, 9 Sep 2025 17:46:49 -0700 Subject: [PATCH 2/4] resolved the HandleNaN error --- main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 2441321..e448f7b 100644 --- a/main.cpp +++ b/main.cpp @@ -14,7 +14,8 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; + cout << "Division: " << + (y == 0 ? "Dividing by zero is not a number." : std::to_string(x / y)) << endl; cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl; From 8e3a4647295bc5b6fbef4aa4c6715d61d95b8ee3 Mon Sep 17 00:00:00 2001 From: Arnav Date: Wed, 10 Sep 2025 11:31:00 -0700 Subject: [PATCH 3/4] Resolved conflicts --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index e448f7b..f393907 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,7 @@ using namespace std; int main() { + cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; cout << "Hi, please enter two whole numbers: "; int x,y; From cb516b8c98bc6502f2c6a1fb288e7c8c3fe9f899 Mon Sep 17 00:00:00 2001 From: Arnav Date: Wed, 10 Sep 2025 11:33:31 -0700 Subject: [PATCH 4/4] Resolved Conflicts --- main.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/main.cpp b/main.cpp index f393907..a495fc9 100644 --- a/main.cpp +++ b/main.cpp @@ -1,25 +1,21 @@ #include #include -using namespace std; - - int main() { - cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - cout << "Hi, please enter two whole numbers: "; + std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + std::cout << "Hi, please enter two whole numbers: "; int x,y; - cin >> x >> y; - cout << "Addition: " << x + y << endl; - cout << "Subtraction: " << x - y << endl; - cout << "Multiplication: " << x * y << endl; - cout << "Division: " << - (y == 0 ? "Dividing by zero is not a number." : std::to_string(x / y)) << endl; - cout << "Remainder: " << x % y << endl; - cout << "Square Root: " << sqrt(x) << endl; - cout << "Square: " << pow(x, y) << endl; + std::cin >> x >> y; + 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 << "Remainder: " << x % y << std::endl; + std::cout << "Square Root: " << sqrt(x) << std::endl; + std::cout << "Square: " << pow(x, y) << std::endl; return 0; }