diff options
Diffstat (limited to 'lang/cpptour/square.cc')
-rw-r--r-- | lang/cpptour/square.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/cpptour/square.cc b/lang/cpptour/square.cc new file mode 100644 index 0000000..fb14456 --- /dev/null +++ b/lang/cpptour/square.cc @@ -0,0 +1,21 @@ +#include <iostream> + +using namespace std; + +double +square (double x) +{ + return x * x; +} + +void +print_square (double x) +{ + cout << "the quare of " << x << " is " << square (x) << endl; +} + +int +main () +{ + print_square (1.234); +} |