From 436d39e6659e4bc4ec217eaf8e958be764bedc61 Mon Sep 17 00:00:00 2001 From: Maxwell Date: Mon, 2 Feb 2026 13:13:18 -0800 Subject: [PATCH 1/2] added using std::cin; using std::cout; using std::endl; added double space indents (rather than tabs) --- main.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/main.cpp b/main.cpp index a495fc94..8ccfadb2 100644 --- a/main.cpp +++ b/main.cpp @@ -1,21 +1,28 @@ #include #include +using std::cin; +using std::cout; +using std::endl; int main() { - std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - std::cout << "Hi, please enter two whole numbers: "; + cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + cout << "Hi, please enter two whole numbers: "; int x,y; - 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; + cin >> x >> y; + cout << "Addition: " << x + y << endl; + cout << "Subtraction: " << x - y << endl; + cout << "Multiplication: " << x * y << endl; + if ( y== 0 ) { + cout << "Divding by zero is niot a number\n"; + } + else {cout << "Division: " << x / y << endl; + } + cout << "Remainder: " << x % y << endl; + cout << "Square Root: " << sqrt(x) << endl; + cout << "Square: " << pow(x, y) << endl; return 0; } From d16560dd112b520eef5eb417307d446613550e2d Mon Sep 17 00:00:00 2001 From: Maxwell Date: Mon, 2 Feb 2026 13:47:02 -0800 Subject: [PATCH 2/2] added using std::cin; using std::cout; using std::endl; added double space indents (rather than tabs) --- main.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/main.cpp b/main.cpp index 8ccfadb2..bd7ffc7e 100644 --- a/main.cpp +++ b/main.cpp @@ -6,23 +6,24 @@ using std::endl; int main() { - cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - cout << "Hi, please enter two whole numbers: "; + cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + cout << "Hi, please enter two whole numbers: "; - int x,y; + int x,y; - cin >> x >> y; - cout << "Addition: " << x + y << endl; - cout << "Subtraction: " << x - y << endl; - cout << "Multiplication: " << x * y << endl; - if ( y== 0 ) { - cout << "Divding by zero is niot a number\n"; - } - else {cout << "Division: " << x / y << endl; - } - cout << "Remainder: " << x % y << endl; - cout << "Square Root: " << sqrt(x) << endl; - cout << "Square: " << pow(x, y) << endl; + cin >> x >> y; + cout << "Addition: " << x + y << endl; + cout << "Subtraction: " << x - y << endl; + cout << "Multiplication: " << x * y << endl; + if ( y== 0 ) { + cout << "Divding by zero is niot a number\n"; + } + else { + cout << "Division: " << x / y << endl; + } + cout << "Remainder: " << x % y << endl; + cout << "Square Root: " << sqrt(x) << endl; + cout << "Square: " << pow(x, y) << endl; - return 0; + return 0; }