C程序设计基础试卷.docVIP

  • 3
  • 0
  • 约1.59千字
  • 约 6页
  • 2016-11-29 发布于江西
  • 举报
C程序设计基础试卷

找出下列项中C语言常量,并指出它们的类型。 找出下列代码中的错误并说明错误的原因。 #include stdio.h main() { int a,b,*p; p=a; scanf(%d%d,p, b); if ab printf(%d,%d\n ,a,b,); else printf(%d,%d ,a,b,x); } 1. #include stdio.h main() { int a[8]={2,7,16,8,9,12,5,6},i; for(i=0;i8;i++) if(a[i] %2==0) a[i]=a[i]/2; for (i=5;i=0;i--) printf(%5d , a[i]); } 输出结果为: 2. #include stdio.h main() { char a[100]=fire, b[100]=computer; char *p1,*p2; int i; p1=a; p2=b; while(*p1!=\0) { putchar(*p1); *p2=*p1; p1++; p2=p2+2; } putchar(\n); puts(b); } 输出结果为: 3. #include stdio.h main() {

文档评论(0)

1亿VIP精品文档

相关文档