第三章C程序的三种基本结构.docVIP

  • 6
  • 0
  • 约7.54千字
  • 约 14页
  • 2016-11-06 发布于重庆
  • 举报
第三章C程序的三种基本结构

第三章C程序的三种基本结构 (1)以下程序输出的结果是 #includestdio.h main() { int a=-1,b=1,k; if((++a0)!(b--=0)) printf(%d,%d\n,a,b); else printf(%d,%d\n,a,b); } (2)以下程序输出的结果是 #includestdio.h main() { int a=2,b=-1,c=2; if(ab) if(b0)c=0; else c+=1; printf(%d\n,c); } (3)以下程序输出的结果是 #includestdio.h main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++,b++; } printf(a=%d,b=%d\n,a,b); } (4)以下程序输出的结果是 #includestdio.h main() { float x=2.0,y; if(x0.0) y=0.0; else if(x10.0) y=1.0/x; else y=1.0; printf(%f\n,y); } (5)

文档评论(0)

1亿VIP精品文档

相关文档