2009年4月全国计算机等级二级C笔试考前练习习题(23)计算机二级考试

文章作者 100test 发表时间 2009:04:10 01:29:37
来源 100Test.Com百考试题网


  2009年4月,全国计算机等级二级C考试你准备好了没?考计算机等级二级C语言考试的朋友可以多关注一下百考试题为大家整理的2009年4月,全国计算机等级二级C语言考前练习!希望对大家的备考有好的帮助!百考试题祝各位考个好成绩!大家每天都来练习哦!不断的加强巩固!每天都有更新哦!百考试题提示:每十道题的难度不同!继续上一篇...
  1.在下列叙述中,错误的一条是()
  A)scanf()函数可以用来输入任何类型的多个数据
  B)数组名作函数参数时,也采用“值传递”方式
  C)如果形参发生改变,不会改变主调函数的实参值
  D)函数的实参与形参的类型应一致

  2.有以下程序
  union myun
  {struct
  {intx,y,z.}u.
  int k.
  }a.
  main()
  {a.u.x=4.a.u.y=5.a.u.z=6.
  a.k=0.
  printf(“%d\n”,a.u.x).
  }
  程序运行后的输出结果是()
  A)4
  B)5
  C)6
  D)0

  3.以下程序的输出结果是()
  #include
  main()
  { chars1[]="123",s2[]="abc",ss[20]="010";
  strcat(ss 1,strcpy(s2,s1)).
  printf("%s\n",ss).
  }
  A)010123
  B)0abc
  C)01123
  D)01abc

  4.有以下程序
  # include
  main()
  { int *p,j.
  p=NULL.
  p=fun().
  for(j=0.j<.4.j ){printf("%d",*p).p .}
  }
  int*fun()
  {
  int a[4],k.
  for(k=0.k<.4.k )a[k]=k.
  return(a).
  }
  程序运行后的输出结果是()
  A)程序有错不能运行
  B)输出4个NULL
  C)输出0 1 2 3
  D)输出1 1 1 1

  5.有以下程序:
  void fun(intk)
  { static inta[5]. int i.
  for(i=0.i<.5.i )
  { a[i] =i k.printf("%d",a[i]).}
  printf("\n").
  }
  main()
  {fun(1).fun(2).}
  程序的输出结果是()
  A)1 2 3 4 5
  B)随机数
  C)1 2 3 4 5
  D)1 2 3 4 5
  3 5 7 9 11 2 3 4 5 6 2 4 6 8 10

  6.有以下程序
  main()
  {int m,n.
  printf("Enter m,n∶").scanf("%d%d",&.m,&.n).
  while(m!=n)
  {while(m>.n)m-=n.
  while(n>.m)n-=m.
  }
  printf("m=%d\n",m).
  }
  如果从键盘上输入65 14<.回车>.,则输出结果为()
  A)m=3
  B)m=2
  C)m=1
  D)m=0

  7.以下程序的输出结果是()
  void fun(float *p1,float *p2,float *s)
  { s=(float*)calloc(1,sizeof(float)).
  *s=*p1 *p2 .
  }
  main()
  { floats[2]={1.1,2.2},b[2]={10.0,20.0},*s=a.
  fun(a,b,s).
  printf("%5.2f\n",*s).
  }
  A)11.10
  B)12.00
  C)21.10
  D)1.10

  8.有以下程序
  #include
  #include
  fun(char*w,int n)
  {char t,*s1,*s2.
  s1=w.s2=w n-1.
  while(s1<.s2).
  {t=*s1 .
  *s1=*s2--.
  *s2=t.
  }
  }
  main()
  {charp[]="1234567".
  fun(p,strlen(p)).
  puts(p).
  }
  程序运行后的输出结果是()
  A)1234567
  B)7654321
  C)1711717
  D)7177171

  9.若有如下程序:
  struct student
  {char name[10];
  float score[3];}stu[3]={{"lili",75,90,90},
  {"liudan",90,85,75}.
  {"guoli",85,85,70}}.
  main()
  {int i.float sum=0,aver.
  for(i=0.i<.3.i )
  sum=sum stu[i].score[1].aver=sum/i.
  printf("%6.2f\n",aver).}
  则程序运行后的输出结果是()
  A)83.33
  B)85.00
  C)86.00
  D)86.67

  10.有如下定义:
  struct person
  {char name[9].int age.}
  struct person class[10]={"John",17,
  "Paul",19,
  "Mary",18,
  "Adam",16}.
  能输出字母M的是()
  A)printf("%c\n",class[3].name).
  B)printf("%c\n",class[3].name[1]).
  C)printf("%c\n",class[2].name[1]).
  D)printf("%c\n",class[2].name[0]).

  答案:1.B 2.D 3.A 4.A 5.A 6.C 7.D 8.C 9.D 10.D



相关文章


2009年4月全国计算机等级二级C笔试考前练习习题(25)计算机二级考试
2009年4月全国计算机等级二级C笔试考前练习习题(24)计算机二级考试
2009年4月全国计算机等级二级C笔试考前练习习题(23)计算机二级考试
2009年4月全国计算机等级二级C笔试考前练习习题(22)计算机二级考试
2009年4月全国计算机等级二级C笔试考前练习习题(21)计算机二级考试
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛