计算机等级 > 二级考试 > C语言程序设计 > C语言模拟试题 > 文章内容

计算机二级C语言程序设计考前测试题及答案(6)

2017-5-27编辑:daibenhua

计算机二级C语言程序设计考前测试题及答案

  阅读程序题

  1、int x=6, y=7;

  printf(“%d,”,x++); printf(“%d\n”,++y);

  程序的输出结果是__________。

  2、float f=3.1415927;

  printf(“%f,%5.4f,%3.3f”,f,f,f);

  则程序的输出结果是__________。

  3、a=3;

  a+=(a<1)?a:1; printf(“%d”,a);

  结果是__________。

  4、main( )

  { int a[5]={2,4,6,8,10},*P,* *k;

  p=a; k=&p;

  printf("%d,",*(p++));

  printf("%d\n",* *k); }

  程序的输出结果是__________。

  5、 main()

  {int a,b;

  for (a=1,b=1;a<=100;a++)

  { if(b>=20) break;

  if(b%3==1)

  {b+=3; continue; }

  b-=5; } }

  程序的输出结果a的值为__________。

  参考答案:

  (1) 6,8

  (2) 3.141593,3.1416,3.142

  (3) 4

  (4) 2,4

  (5) 8

计算机二级C语言程序设计考前测试题及答案(5)

热点推荐

登录注册
触屏版电脑版网站地图