home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / EX3.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  334 b   |  17 lines

  1. // ex3.cpp:   Inline Functions
  2. // from Chapter 6 of Getting Started
  3. #include <iostream.h>
  4.  
  5. const float Pi = 3.1415926;
  6.  
  7. inline float area(const float r) {return Pi * r * r;}
  8.  
  9. main()
  10. {
  11.    float radius;
  12.  
  13.    cout << "Enter the radius of a circle: ";
  14.    cin >> radius;
  15.    cout << "The area is " << area(radius) << "\n";
  16. }
  17.