home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
TC-300
/
EXAMPLES
/
EX3.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-17
|
396b
|
20 lines
// Borland C++ - (C) Copyright 1991 by Borland International
// ex3.cpp: Inline Functions
// from Hands-on C++
#include <iostream.h>
const float Pi = 3.1415926;
inline float area(const float r) {return Pi * r * r;}
main()
{
float radius;
cout << "Enter the radius of a circle: ";
cin >> radius;
cout << "The area is " << area(radius) << "\n";
return 0;
}