- 3
- 0
- 约 51页
- 2017-09-08 发布于河南
- 举报
《C程序设计》清华大学出版社 PPT教程 第4章_简单程序1
4.5 格式输入与输出 例4.6 输出实数时的有效位数。#include stdio.hvoid main(){ float x,y; x=111111.111;y=222222.222; printf(″%f″,x+y);} 运行结果:333333.328125 4.5 格式输入与输出 例4.7输出双精度数时的有效位数。#include stdio.hint main(){double x,y; x=1111111111111.111111111; y=2222222222222.222222222;printf(“%f”,x+y);} 运行结果:3333333333333.333010 4.5 格式输入与输出 例4.8 输出实数时指定小数位数。#include stdio.hvoid main() {float f=123.456;printf(“%f%10f%10.2f%.2f%-10.2f\n”,f,f,f,f,f);} 运行结果:123.455994 123.455994 123.46 123.46 123.46 4.5 格式输入与输出 例 数据的输出。#includestdio.hvoid main(){float a,b;
原创力文档

文档评论(0)