C程序设计第四版第4章选择结构-2.pptVIP

  • 113
  • 0
  • 约8.9千字
  • 约 51页
  • 2016-12-29 发布于湖北
  • 举报
以下程序的输出结果是()。 #include ”stdio.h” main() { int a=5, b=4, c=6, d; printf(”%d\n”, d=ab? ac?a:c :b); } 以下程序的运行结果是()。 #include ”stdio.h” main() { int a=2,b= -1,c=2; if (ab) if (b0) c=0; else c++; printf(”%d\n”,c); } 4.7 switch语句 有以下程序,若输入为字符s,则程序运行结果为() #include stdio.h main() { char ch; ch=getchar(); switch (ch) { case a: printf(a=%c\n,ch); default: printf(end!\n); case b: printf(b=%c\n,ch); case c: printf(c=%c\n,ch); } } 执行下列程序,输入为3的数出结果是()。 #include stdio.h main() { int k; scanf(%d, k); switch(k) { case 1: printf(%d\n, k++); case 2: printf(%d\n, k++); case 3: printf(%d\n, k

文档评论(0)

1亿VIP精品文档

相关文档