/* Filename: roots1.cpp Author: Br. David Carlson Date: January 4, 2000 Modified: June 26, 2000; August 19, 2001 This program prints a table of square roots for the numbers 1, 2, 3, ... 20. Tested with: Microsoft Visual C++ 6.0 Microsoft Visual C++ .NET g++ under Linux */ #include #include // Needed in order to use sqrt function. using namespace std; const int Max = 20; int main(void) { int k; cout << "Number: Square root:" << endl; for (k = 1; k <= Max; k++) cout << k << " " << sqrt(k) << endl; return 0; }