[user02@FC4 Lesson12]$ cat -n sqrt.cpp
1 #include <iostream>
2 #include <cmath> // Contains sqrt prototype
3 using namespace std;
4
5 int main()
6 {
7 cout << "The square root of 100.0 is " << sqrt(100.0) << endl;
8 cout << "The square root of 10.0 is " << sqrt(10.0) << endl;
9 cout << "The square root of 5. 0 is " << sqrt(5.0) << endl;
10
11 return 0;
12 }
[user02@FC4 Lesson12]$ g++ -o sqrt sqrt.cpp[user02@FC4 Lesson12]$ ./sqrt
The square root of 100.0 is 10
The square root of 10.0 is 3.16228
The square root of 5. 0 is 2.23607
[user02@FC4 Lesson12]$
lesson_12_sqrt.cpp, Rev. 2, Last changed on 2005-08-18 07:00, 487 page hits