#include <iostream.h>
#include <conio.h>
void main()
{
int in, yrd, ft, r;
cout<< " Enter distance/length in inches ";
cin>> in;
yrd = in/ 36; // calculate yard
r = in % 36; // remaining inches
ft = r / 12; // calculate feet
r = r % 12; // remaining inches
cout<< " \n The distance in inches is " << in ;
cout << " \n The equivalent yard-feet-inches = " << yrd << " yard" << ft << "feet" << r << "inches" ;
getch();
}
#include
{
int in, yrd, ft, r;
cout<< " Enter distance/length in inches ";
cin>> in;
yrd = in/ 36; // calculate yard
r = in % 36; // remaining inches
ft = r / 12; // calculate feet
r = r % 12; // remaining inches
cout<< " \n The distance in inches is " << in ;
cout << " \n The equivalent yard-feet-inches = " << yrd << " yard" << ft << "feet" << r << "inches" ;
getch();
}
No comments:
Post a Comment