版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huoyongliang/article/details/88746071
#include<stdio.h>
int main()
{
float f;
f = 12.34567;
printf("f的值为 :%f \n", f);
printf("f的值为 :%.2f \n", f);
return 0;
}
输出结果
f的值为 :12.345670
f的值为 :12.35