home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / EXAMPLES.ZIP / EX3.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  396 b   |  20 lines

  1. // Borland C++ - (C) Copyright 1991 by Borland International
  2.  
  3. // ex3.cpp:   Inline Functions
  4. // from Hands-on C++
  5. #include <iostream.h>
  6.  
  7. const float Pi = 3.1415926;
  8.  
  9. inline float area(const float r) {return Pi * r * r;}
  10.  
  11. main()
  12. {
  13.    float radius;
  14.  
  15.    cout << "Enter the radius of a circle: ";
  16.    cin >> radius;
  17.    cout << "The area is " << area(radius) << "\n";
  18.    return 0;
  19. }
  20.