I have to write a program where centimeters is converted to feet and inches. For example, the input is 333.3 cm, the output should be 10 ft and 11.2 inches. I already have written the program as follow;
#include <stdio.h>
#include <stdlib.h>
#define In 2.54
#define Ft 12
void main ()
{
int a;
float X;
printf ("\nEnter the value to be converted: ");
scanf ("%d", &a);
X=(a/In/Ft);
printf ("The area: %5.2f\n", X);
getch ();
}
The result I got for 333.3 cm is 10.93. My question is how to convert that 0.93 to 11.2 inches. Any response will be truly appreciated. Thank you!