C++ examples for Data Type:float
Converts pounds to kilograms
#include <iostream> using namespace std; float lbstokg(float); //declaration int main()/*from www .j ava 2 s.com*/ { float lbs; cout << "\nEnter your weight in pounds: "; cin >> lbs; cout << "Your weight in kilograms is " << lbstokg(lbs) << endl; return 0; } // converts pounds to kilograms float lbstokg(float pounds) { return 0.453592 * pounds; }