求初级C语言朋友解答,刚刚接触C语言,问题一大堆
等爱的蜘蛛 2011-11-02 06:06:54 编译之后红色字体表达式语法错误
#include <stdio.h>
#include <float.h>
int main()
{
puts("\nCharacteristics of the type float\n");
printf("Storage size: %d bytes\n"
"Smallest positive value:%E\n"
"Greatest positive value:%E\n"
"Precision:%d decimal digits\n",
sizeof(float),FLT_MIN,FLT_MAX,FLT_DIG);
puts("\nAn example of float precision:\n");
double d_var=12345.6;
float f_var=(float)d_vat; printf("The floating-point number "
"%18.10f\n",d_var);
printf("has been srored in avariable\n"
"of type float as the value "
"%18.10f\n",f_var);
printf("The rounding error is "
"%18.10f\n",d_var-f_var);
return 0;
}