关于数据类型的一个小问题
为什么我添加一个b 变量后 结果就不对了呢,是我 定义b的数据类型不对? 如果这样的话 应该定义为什么类型,我试过double也是不对的
程序代码:#include <stdio.h>
int main(void)
{
/*float a;
printf("please input your height(by the inch):\n");
scanf("%f",&a);
printf("Your height %f inch converted the centimeter is %f centimeter",a,a*2.54);
return 0;*/
/*输入1 结果为2.540000*/
float a,b;
b=a*2.54;
printf("please input your height(by the inch):\n");
scanf("%f",&a);
printf("Your height %f inch converted the centimeter is %f centimeter",a,b);
return 0;
/*输入1 结果为-27273040.0000000 */







