我编写了这个程序,它将输入的高度(以厘米为单位)更改为英尺和英寸。当我运行它时,结果不断出现而不会停止。有谁知道为什么?
#include <stdio.h>
int main (void)
{
float heightcm;
float feet;
float inch;
printf("Enter height in centimeters to convert \n");
scanf("%f", &heightcm);
while (heightcm > 0)
{
feet = heightcm*0.033;
inch = heightcm*0.394;
printf("\n %0.1f cm = %0.2f feet and %0.2f inches \n", heightcm,feet,inch);
}
return 0;
}