设为首页 加入收藏

TOP

07年4月等级考试二级C语言考前密卷(6)(二)
2014-11-23 19:53:24 来源: 作者: 【 】 浏览:23
Tags:07年 4月 等级考试 二级 语言 考前
下面程序,执行后的结果为
  #include "stdio.h"
  void fun(int *a,int *b)
  { int k;
   k=5;
   *a=k;
   *b=*a+k;}
  main()
  { int *a,*b,x=10,y=15;
  a=&x;
  b=&y;
  fun(a,b);
  printf("%d,%d\n",*a,*b);}
  A)10,15
  B)5,15
  C)5,10
  D)15,10
(34)阅读下面程序,在程序执行后的结果为
  #include "stdio.h"
  int *fun(int *a,int *b)
  { int m;
  m=*a;
  m+=*b-3;
  return(&m);}
  main()
  {int x=21,y=35,*a=&x,*b=&y;
  int *k;
  k=fun(a,b);
  printf("%d\n",*k);}
  A)53
  B)21
  C)35
  D)14
(35)已知int a[10];则对a数组元素的正确引用是
  A)a[10]
  B)a
  C)a+5
  D)a[10-10]
(36)在C语言中,一维数组的定义方法为
  类型说明符 数组名
  A)[常量表达式]
  B)[整型常量]
  C)[整型变量]
  D)[整型常量]或[整型表达式]
(37)阅读下列程序,则运行结果为
  #include "stdio.h"
  fun()
  { static int x=5;
   x++;
   return x;}
  main()
  { int i,x;
   for(i=0;i<3;i++)
   x=fun();
   printf("%d\n",x);}
  A)5
  B)6
  C)7
  D)8
(38)下列程序的输出结果是
  #include "stdio.h"
  #defineM(x,y)x%y
  main()
  { int a,m=12,n=100;
  a=M(n,m);
  printf("%d\n",a--);}
  A)2
  B)3
  C)4
  D)5


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇07年4月等级考试二级C语言考前密.. 下一篇07年4月等级考试二级C语言考前密..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: