#include<stdio.h>
#define CM_TO_FEET 30.48
#define CM_TO_INCH 2.54
int main()
{
float cm,inch;
int feet;
printf("Enter a height in centimeters: ");
scanf("%f",&cm);
while(cm>0)
{
feet = cm / CM_TO_FEET;
inch = (cm - feet*CM_TO_FEET) / CM_TO_INCH;
printf("%.1f cm = %d feet ,%.1f inchess\n",cm,feet,inch);
printf("Enter a height in centimeters(<=0 to quit):");
scanf("%f",&cm);
}
printf("bye\n");
return 0;
}
#define CM_TO_FEET 30.48
#define CM_TO_INCH 2.54
int main()
{
float cm,inch;
int feet;
printf("Enter a height in centimeters: ");
scanf("%f",&cm);
while(cm>0)
{
feet = cm / CM_TO_FEET;
inch = (cm - feet*CM_TO_FEET) / CM_TO_INCH;
printf("%.1f cm = %d feet ,%.1f inchess\n",cm,feet,inch);
printf("Enter a height in centimeters(<=0 to quit):");
scanf("%f",&cm);
}
printf("bye\n");
return 0;
}