- 1
- 0
- 约1.16千字
- 约 17页
- 2020-06-03 发布于广东
- 举报
/*ch3_1.c*/
#include stdio.h
main()
{ int c;
char a;
c=65; a=B;
putchar(c); putchar(\n); putchar(a);
};格式:printf(“格式控制串”,输出表)
功能:按指定格式向显示器输出数据
返值:正常,返回输出字节数;出错,返回EOF(-1);d,i;附加格式说明符(修饰符);例 int a=1234;
float f=123.456;
char ch=‘a’;
printf(“%8d,%2d\n”,a,a);
printf(“%f,%8f,%8.1f,%.2f,%.2e\n”,f,f,f,f,f);
printf(“%3c\n”,ch);;例 int a=1234;
float f=123.456;
static char c[]=“Hello,world!”;
printf(“%8d,%-8d\n”,a,a);
printf(“%10.2f,%-10.1f\n”,f,f);
printf(“%10.5s,%-10.3s\n”,c,c);;例 int a=1234;
float f=123.456;
prin
原创力文档

文档评论(0)