/* Filename: roots1.cpp Author: Br. David Carlson Br. Isidore Minerd Date: January 4, 2000 Modified: June 26, 2000; August 19, 2001; July 16, 2009 This program prints a table of square roots for the numbers 1, 2, 3, ... 20. Tested with: Microsoft Visual Studio 2005 Microsoft Visual Studio 2008 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(static_cast(k)) << endl; return 0; }