PracticeDev/study_cpp/cpp_primer_source_code/Chapter 2/convert.cpp

22 lines
454 B
C++

// convert.cpp -- converts stone to pounds
#include <iostream>
int stonetolb(int); // function prototype
int main()
{
using namespace std;
int stone;
cout << "Enter the weight in stone: ";
cin >> stone;
int pounds = stonetolb(stone);
cout << stone << " stone = ";
cout << pounds << " pounds." << endl;
// cin.get();
// cin.get();
return 0;
}
int stonetolb(int sts)
{
return 14 * sts;
}