// Sqrt.C // demonstrates use of double (floating-point) numbers // and the math library // Presented in class on Feb 12, 1997 #include #include void main() { double x ; cout << "Enter x: " ; cin >> x ; if ( x < 0.0 ) { cout << "The square root is imaginary" << endl ; } else { cout << "The square root of " << x << " is " << sqrt(x) << "\n" ; } }