#include int main() { double x; cout << "Enter a number: "; cin >> x; // <= >= > < == != if (x < 0) // equivalent to (0 > x) { cout << "You can't take a square root of a negative number dummy\n"; cout << "Go back to high school\n"; } else // this is the same as saying "if (x >= 0)" { cout << "The square root of " << x << " is " << sqrt(x) << endl; cout << "The square of " << x << " is " << x*x << endl; } if (x == 0) // equivalent (0 == x) { cout << "You can't take the reciprocal of zero dummy\n"; } else { cout << "The reciprocal of " << x << " is " << 1./x << endl; } }