I am writing a simple program to convert mm to feet and inches.
I have it as follows:
#include <stdio.h>
#include <math.h>
void main()
{
int x=11;
float mm=0;
float answer=0;
do
{
printf("\nPlease enter your metric millimeter. - ");
scanf("%f",&mm);
answer=mm*0.0032808399;
printf("\n%.0f mm's is equal to %.2f Ft.\n",mm,answer);
x=x--;
}
while (x>1);
}
Although this does fine to get the feet extracted, I would like to know how to
get the inches instead of a decimal number, like how to split a number like
5000mm into 16.4042 FT. The sixteen feet is ok. I'd like to see how to get the
.4042 turned into 4 13/16" and print that out.
Thanks, Keith