sqrt.cpp 466 B

123456789101112131415161718192021
  1. // sqrt.cpp -- using the sqrt() function
  2. #include <iostream>
  3. #include <cmath> // or math.h
  4. int main()
  5. {
  6. using namespace std;
  7. double area;
  8. cout << "Enter the floor area, in square feet, of your home: ";
  9. cin >> area;
  10. double side;
  11. side = sqrt(area);
  12. cout << "That's the equivalent of a square " << side
  13. << " feet to the side." << endl;
  14. cout << "How fascinating!" << endl;
  15. // cin.get();
  16. // cin.get();
  17. return 0;
  18. }