Below is a code I wrote to convert user input of inches to miles, yards, feet. My only issue is that the format in which I would like this to be output would require the output to have "0 inches" as well.
For the life of me I cannot figure that much out. I tried setting a new int value to inches and have it return 0, but that just confused things even more.
Thanks for any help.
#include <iostream>
using namespace std;
int
main ()
{
double m;
double y;
double f;
double i;
cout << " Enter the Length in inches:";
cin >> i;
m = i / 63360; // Convert To Miles
y = 1760 * m; // Convert To Yards
f = 3 * y; // Convert to Feet
i = 12 * f; // Convert to Inches
cout << i << "inches =" << " " << m << " " << "(mile)s," << " " <<
y << " " << "yards," << " " << f << " " << "feet," << " " << i <<
" " << "inches." << endl;
return 0;