diff --git a/main.cpp b/main.cpp index 5411e7a..970ceb3 100644 --- a/main.cpp +++ b/main.cpp @@ -10,14 +10,25 @@ int main() 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; - cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; + + if (y != 0) + { + cout << "Division: " << x / y << endl; + cout << "Remainder: " << x % y << endl; + } + else + { + cout << "Dividing by zero is not a number." << endl; + cout << "Dividing by zero is not a number." << endl; + } + cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl;