C++ examples for Function:Function Creation
Demonstrate inline functions
#include <iostream> using namespace std; // converts pounds to kilograms inline float lbstokg(float pounds) { return 0.453592 * pounds; } int main()/*from w w w . jav a2 s. co m*/ { float lbs; cout << "\nEnter your weight in pounds: "; cin >> lbs; cout << "Your weight in kilograms is " << lbstokg(lbs) << endl; return 0; }