【计算机类职业资格】二级C语言笔试-137及答案解析.doc

上传人:explodesoak291 文档编号:1325972 上传时间:2019-10-17 格式:DOC 页数:19 大小:62KB
下载 相关 举报
【计算机类职业资格】二级C语言笔试-137及答案解析.doc_第1页
第1页 / 共19页
【计算机类职业资格】二级C语言笔试-137及答案解析.doc_第2页
第2页 / 共19页
【计算机类职业资格】二级C语言笔试-137及答案解析.doc_第3页
第3页 / 共19页
【计算机类职业资格】二级C语言笔试-137及答案解析.doc_第4页
第4页 / 共19页
【计算机类职业资格】二级C语言笔试-137及答案解析.doc_第5页
第5页 / 共19页
点击查看更多>>
资源描述

1、二级 C 语言笔试-137 及答案解析(总分:96.00,做题时间:90 分钟)一、选择题(总题数:30,分数:60.00)1.设有以下说明语句,则变量 a_。char a=/72;(分数:2.00)A.包含 1 个字符B.包含 2 个字符C.包含 3 个字符D.该说明不合法2.下列程序的运行结果为_。main ( )int a, *p;p=a=100;printf(“a=%d *p=%d *a+;printf(“a+=%d “,a);(*p) +;printf(“(*p)+=%d “,*p);*p+;printf (“*p+=%d/n“, *p);(分数:2.00)A.a=100 *p=10

2、0 *s1=w; s2=w+n-1;while (s1s2)t=*s1+;*s1=*s2-;*s2=t;main ()char *p;p=“1234567“;fun (p, strlen (p);puts (p);(分数:2.00)A.1234567B.7654321C.1711717D.71771715.以下对枚举类型名的定义中正确的是_。(分数:2.00)A.enum a=one,two,three;B.enum aone=9,two=-1,three;C.enum a=one“,“two“,“three“;D.enum a“one“,“two“,“three“;6.有一个深度为 4 的满

3、二叉树,下面关于序号为 7 的结点的叙述中,正确的是_。(分数:2.00)A.该结点双亲的序号为 4B.该结点处于二叉树的第 4 层C.该结点没有右子树D.该结点左子树根结点的序号为 147.若有以下定义和语句,则输出结果是_。char*s1=“12345“,*s2=“1234“;printf(“%d/n“,strlen(strcpy(s1,s2);(分数:2.00)A.4B.5C.9D.108.下面程序运行的结果是_。main()int x,y,z;x=0; y=z=-1;x+=-z-y;printf(“x=%d/n“,x);(分数:2.00)A.x=4B.x=0C.x=2D.x=39.在

4、C 语言中,如果下面的变量都是血类型,则输出的结果是_。sum=pad=5;pAd=sum+,pad+,+pAd;printf(“%d/n“,pad);(分数:2.00)A.7B.6C.5D.410.设有二维数组 A89,其每个元素占 2 个字节,从首地址 400 开始,按行优先顺序存放,则元素A8,5的存储地址为_。(分数:2.00)A.570B.506C.410D.48211.软件危机是大型软件开发中出现的现象,下列选项中的_是其主要表现。软件生产的复杂性。软件生产进度无法控制。软件生产高成本、无法控制。软件需求定义不准确。(分数:2.00)A.全部B.和C.、和D.和12.在下列叙述中,

5、不正确的一条是_。(分数:2.00)A.在 C 语言中,函数中的自动变量可以赋初值,每调用一次,赋一次初值B.在 C 语言中,外部变量的隐含类别是自动存储类别C.在 C 语言中,在调用函数时,实际参数和对应形参在类型上只需赋值兼容D.在 C 语言中,函数形参可以说明为 register 变量13.下列程序的输出结果是_。main()int i,k,a10,p3;k=5;for (i=0;i10;i+) ai=ifor (i=0;i3;i+) pi=ai*(i+1);for (i=0;i3;i+)k+=pi*2;printf(“%d/n“,k);(分数:2.00)A.20B.21C.22D.23

6、14.若变量已正确定义并赋值,下面符合 C 语言语法的表达式是_。(分数:2.00)A.a:=b+1;B.a=b=C+2;C.int18.5%3;D.a=a+7=c+b;15.下列程序的输出结果是_。#includemain()char b30,*chp;strcpy(for (i=1;i=NUM;i+) printf (“%d/n“, i);(分数:2.00)A.5B.6C.7D.829.假定 a 和 b 为 int 型变量,则执行以下语句后,b 的值为_。a=1;b=10;dob-=a; a+; while (b-0);(分数:2.00)A.9B.-2C.-1D.830.下列叙述中,正确的

7、一条是_。(分数:2.00)A.语句 int*pt 中的*pt 是指针变量名B.运算符*和a=10;b=2;c=! (a%b) ;x=! (a/b);y=(ab) z=(ab) | (b=0);printf (“c=%d, x=%d, y=%d, z=%d/n“, c,x, y, z);(分数:4.00)填空项 1:_35.以下函数用来求出 2 个整数之和,并通过形参将结果传回。 void func(int x, int y, 【6】 z)*z=x+y; (分数:4.00)填空项 1:_36.下列程序的运行结果为 【7】 。main ( )int i, j, row=0, colum=0, m

8、ax,a3 4=1,2,3,4, 9,8,7,6, -10,10,-5,2;max=a0 0;for (i=0;i3;i+)for (j=0; j4; j+)if (maxa i j)max=ai j;row=i;colum=j;printf(“max=%-5d row=%-3d colum=%-3d/n“,max, row, colum);(分数:4.00)填空项 1:_37.下列程序的输出结果是 【8】 。int t(int x, int y, int cp, int dp)cp=x*x+y*y;dp=x*x-y*y;main ()int a=4, b=3, c=5, d=6;t (a,b

9、 c,d);printf(“%d %d /n“,c,d);(分数:4.00)填空项 1:_38.输出若干学生 3 门课程的成绩。#include stdio.h【9】 struct studentint num;float score3;main ()int i=0, n;float a3;【10】 *ptr 200;printf (“请输入学生学号和 3 门课成绩,学号为 0 表示数据输入结束/n“);doptri=(struct student *)malloc(sizeof(struct student);scanf(“%d%f%f%f“,ptri-scoreO=aO;ptri-sco

10、re1=a1;ptri-score2=a2;if( 【11】 ) break;i+;while(1);n=i-1;【12】 ;for(i=O;i=n;i+)printf(“%-6d%.1f %.1f %.1f/n“,ptri-num, ptri-score0,ptri-score1, ptri-score2);(分数:4.00)填空项 1:_39.下列程序的功能是计算 1100 的整数的累加和。main()int i, sum= 【13】 ;i=1;for( 【14】 )sum+=i;i+;printf(“sum=%d/n“, 【15】 );(分数:4.00)填空项 1:_二级 C 语言笔试-

11、137 答案解析(总分:96.00,做题时间:90 分钟)一、选择题(总题数:30,分数:60.00)1.设有以下说明语句,则变量 a_。char a=/72;(分数:2.00)A.包含 1 个字符 B.包含 2 个字符C.包含 3 个字符D.该说明不合法解析:2.下列程序的运行结果为_。main ( )int a, *p;p=a=100;printf(“a=%d *p=%d *a+;printf(“a+=%d “,a);(*p) +;printf(“(*p)+=%d “,*p);*p+;printf (“*p+=%d/n“, *p);(分数:2.00)A.a=100 *p=100 *s1=w

12、 s2=w+n-1;while (s1s2)t=*s1+;*s1=*s2-;*s2=t;main ()char *p;p=“1234567“;fun (p, strlen (p);puts (p);(分数:2.00)A.1234567B.7654321C.1711717 D.7177171解析:5.以下对枚举类型名的定义中正确的是_。(分数:2.00)A.enum a=one,two,three;B.enum aone=9,two=-1,three; C.enum a=one“,“two“,“three“;D.enum a“one“,“two“,“three“;解析:6.有一个深度为 4 的

13、满二叉树,下面关于序号为 7 的结点的叙述中,正确的是_。(分数:2.00)A.该结点双亲的序号为 4B.该结点处于二叉树的第 4 层C.该结点没有右子树D.该结点左子树根结点的序号为 14 解析:7.若有以下定义和语句,则输出结果是_。char*s1=“12345“,*s2=“1234“;printf(“%d/n“,strlen(strcpy(s1,s2);(分数:2.00)A.4 B.5C.9D.10解析:8.下面程序运行的结果是_。main()int x,y,z;x=0; y=z=-1;x+=-z-y;printf(“x=%d/n“,x);(分数:2.00)A.x=4B.x=0C.x=2

14、 D.x=3解析:9.在 C 语言中,如果下面的变量都是血类型,则输出的结果是_。sum=pad=5;pAd=sum+,pad+,+pAd;printf(“%d/n“,pad);(分数:2.00)A.7B.6C.5 D.4解析:10.设有二维数组 A89,其每个元素占 2 个字节,从首地址 400 开始,按行优先顺序存放,则元素A8,5的存储地址为_。(分数:2.00)A.570 B.506C.410D.482解析:11.软件危机是大型软件开发中出现的现象,下列选项中的_是其主要表现。软件生产的复杂性。软件生产进度无法控制。软件生产高成本、无法控制。软件需求定义不准确。(分数:2.00)A.全

15、部 B.和C.、和D.和解析:12.在下列叙述中,不正确的一条是_。(分数:2.00)A.在 C 语言中,函数中的自动变量可以赋初值,每调用一次,赋一次初值B.在 C 语言中,外部变量的隐含类别是自动存储类别 C.在 C 语言中,在调用函数时,实际参数和对应形参在类型上只需赋值兼容D.在 C 语言中,函数形参可以说明为 register 变量解析:13.下列程序的输出结果是_。main()int i,k,a10,p3;k=5;for (i=0;i10;i+) ai=ifor (i=0;i3;i+) pi=ai*(i+1);for (i=0;i3;i+)k+=pi*2;printf(“%d/n“

16、k);(分数:2.00)A.20B.21 C.22D.23解析:14.若变量已正确定义并赋值,下面符合 C 语言语法的表达式是_。(分数:2.00)A.a:=b+1;B.a=b=C+2; C.int18.5%3;D.a=a+7=c+b;解析:15.下列程序的输出结果是_。#includemain()char b30,*chp;strcpy(for (i=1;i=NUM;i+) printf (“%d/n“, i);(分数:2.00)A.5B.6 C.7D.8解析:29.假定 a 和 b 为 int 型变量,则执行以下语句后,b 的值为_。a=1;b=10;dob-=a; a+; while

17、b-0);(分数:2.00)A.9B.-2C.-1D.8 解析:30.下列叙述中,正确的一条是_。(分数:2.00)A.语句 int*pt 中的*pt 是指针变量名B.运算符*和a=10;b=2;c=! (a%b) ;x=! (a/b);y=(ab) z=(ab) | (b=0);printf (“c=%d, x=%d, y=%d, z=%d/n“, c,x, y, z);(分数:4.00)填空项 1:_ (正确答案:c=1,x=O,y=O,z=1)解析:35.以下函数用来求出 2 个整数之和,并通过形参将结果传回。 void func(int x, int y, 【6】 z)*z=x+y;

18、 (分数:4.00)填空项 1:_ (正确答案:int*)解析:36.下列程序的运行结果为 【7】 。main ( )int i, j, row=0, colum=0, max,a3 4=1,2,3,4, 9,8,7,6, -10,10,-5,2;max=a0 0;for (i=0;i3;i+)for (j=0; j4; j+)if (maxa i j)max=ai j;row=i;colum=j;printf(“max=%-5d row=%-3d colum=%-3d/n“,max, row, colum);(分数:4.00)填空项 1:_ (正确答案:max=10 row=2 colum=

19、1)解析:37.下列程序的输出结果是 【8】 。int t(int x, int y, int cp, int dp)cp=x*x+y*y;dp=x*x-y*y;main ()int a=4, b=3, c=5, d=6;t (a,b, c,d);printf(“%d %d /n“,c,d);(分数:4.00)填空项 1:_ (正确答案:5, 6)解析:38.输出若干学生 3 门课程的成绩。#include stdio.h【9】 struct studentint num;float score3;main ()int i=0, n;float a3;【10】 *ptr 200;printf

20、请输入学生学号和 3 门课成绩,学号为 0 表示数据输入结束/n“);doptri=(struct student *)malloc(sizeof(struct student);scanf(“%d%f%f%f“,ptri-scoreO=aO;ptri-score1=a1;ptri-score2=a2;if( 【11】 ) break;i+;while(1);n=i-1;【12】 ;for(i=O;i=n;i+)printf(“%-6d%.1f %.1f %.1f/n“,ptri-num, ptri-score0,ptri-score1, ptri-score2);(分数:4.00)填空项 1:_ (正确答案:(9)#include alloc.h (10) struct student(11) ptri-num=O (12)free(ptri))解析:39.下列程序的功能是计算 1100 的整数的累加和。main()int i, sum= 【13】 ;i=1;for( 【14】 )sum+=i;i+;printf(“sum=%d/n“, 【15】 );(分数:4.00)填空项 1:_ (正确答案:(13)0 (14) ;sum=100; (15) sum)解析:

展开阅读全文
相关资源
猜你喜欢
  • DIN EN 61753-041-2-2015 Fibre optic interconnecting devices and passive components - Performance standard - Part 041-2 Non-connectorized single-mode OTDR reflecting device for cate.pdf DIN EN 61753-041-2-2015 Fibre optic interconnecting devices and passive components - Performance standard - Part 041-2 Non-connectorized single-mode OTDR reflecting device for cate.pdf
  • DIN EN 61753-042-2-2015 Fibre optic interconnecting devices and passive components - Performance standard - Part 042-2 Plug-pigtail-style and plug-receptacle-style OTDR reflecting .pdf DIN EN 61753-042-2-2015 Fibre optic interconnecting devices and passive components - Performance standard - Part 042-2 Plug-pigtail-style and plug-receptacle-style OTDR reflecting .pdf
  • DIN EN 61753-051-3-2013 Fibre optic interconnecting devices and passive components - Performance standard - Part 051-3 Single-mode fibre plug style fixed attenuators for category U.pdf DIN EN 61753-051-3-2013 Fibre optic interconnecting devices and passive components - Performance standard - Part 051-3 Single-mode fibre plug style fixed attenuators for category U.pdf
  • DIN EN 61753-052-3-2017 Fibre optic interconnecting devices and passive components - Performance standard - Part 052-3 Single-mode fibre non-connectorized fixed attenuator - Catego.pdf DIN EN 61753-052-3-2017 Fibre optic interconnecting devices and passive components - Performance standard - Part 052-3 Single-mode fibre non-connectorized fixed attenuator - Catego.pdf
  • DIN EN 61753-052-6-2017 Fibre optic interconnecting devices and passive components - Performance standard - Part 052-6 Single-mode fibre non-connectorized fixed attenuator - Catego.pdf DIN EN 61753-052-6-2017 Fibre optic interconnecting devices and passive components - Performance standard - Part 052-6 Single-mode fibre non-connectorized fixed attenuator - Catego.pdf
  • DIN EN 61753-053-2-2015 Fibre optic interconnecting devices and passive components - Performance standard - Part 053-2 Non-connectorized single-mode fibre electrically controlled v.pdf DIN EN 61753-053-2-2015 Fibre optic interconnecting devices and passive components - Performance standard - Part 053-2 Non-connectorized single-mode fibre electrically controlled v.pdf
  • DIN EN 61753-053-3-2004 Fibre optic interconnecting devices and passive components performance standard - Part 053-3 Continuously variable attenuators for category U - Uncontrolled.pdf DIN EN 61753-053-3-2004 Fibre optic interconnecting devices and passive components performance standard - Part 053-3 Continuously variable attenuators for category U - Uncontrolled.pdf
  • DIN EN 61753-056-2-2013 Fibre optic interconnecting devices and passive components - Performance standard - Part 056-2 Single mode fibre pigtailed style optical fuse for category C.pdf DIN EN 61753-056-2-2013 Fibre optic interconnecting devices and passive components - Performance standard - Part 056-2 Single mode fibre pigtailed style optical fuse for category C.pdf
  • DIN EN 61753-057-2-2013 Fibre optic interconnecting devices and passive components - Performance standard - Part 057-2 Single mode fibre plug-receptacle style optical fuse for cate.pdf DIN EN 61753-057-2-2013 Fibre optic interconnecting devices and passive components - Performance standard - Part 057-2 Single mode fibre plug-receptacle style optical fuse for cate.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1