C++ Function return statement converts pounds to kilograms

Description

C++ Function return statement converts pounds to kilograms

#include <iostream>
using namespace std;
float lbstokg(float);   //declaration
int main()//  w  w  w  . j a va  2  s  .c o m
{
   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;
}



PreviousNext

Related