Converts pounds to kilograms - C++ Data Type

C++ examples for Data Type:float

Description

Converts pounds to kilograms

Demo Code

#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;
}

Result


Related Tutorials