home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / tcpp / examples / ex3.cpp < prev    next >
C/C++ Source or Header  |  1990-06-09  |  376b  |  22 lines

  1. // ex3.cpp:   Inline-Funktionen
  2. // aus Kapitel 6 der Einführung
  3.  
  4. #include <iostream.h>
  5.  
  6. const float Pi = 3.1415926;
  7.  
  8. inline float area(const float r)
  9. { return Pi * r * r;
  10. }
  11.  
  12. main()
  13. {
  14.    float radius;
  15.  
  16.    cout << "Geben Sie den Radius eines Kreises "
  17.            "an: ";
  18.    cin >> radius;
  19.    cout << "Die Fläche beträgt " << area(radius)
  20.         << "\n";
  21. }
  22.