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

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

1、二级 C 语言笔试 45 及答案解析(总分:100.00,做题时间:90 分钟)一、B选择题/B(总题数:30,分数:60.00)1.下列各 m 的值中,能使 m%3=2, 则表达式(b2)/(b1)的值是_。(分数:2.00)A.0B.2C.4D.87.执行以下语句后的输出结果是_。 int x=3,y=0; printf(“%d,%d”,-1x-10 main () int a2 3=1,3,5,7,9,11,*p; p=(int *)malloc(sizeof(int); fur ( printf (“%d/n“, *p); (分数:2.00)A.1B.7C.9D.119.下列程序的输出

2、结果为_。 main ( ) int p, y=0, x=0; p=x8 | y8; printf(“%d “,p); p+=(p+=2); printf(“%d/n“,p); (分数:2.00)A.-1 0B.0 0C.0 4D.-1 210.若有以下调用语句,则不正确的 fun 函数的首部是_。 main() int a50,n; fun(n, do ai=y%2;i+; y=y/2; while(y=1); for(j=i-1;j=0;j-)printf(“%d“,aj); printf(“/n“); (分数:2.00)A.1000B.10010C.00110D.1010014.进行二分

3、法查找,则线形表_。(分数:2.00)A.必须以顺序方式存储B.必须以链接方式存储,且数据元素已按值排好序C.必须以链接方式存储D.必须以顺序方式存储,且数据元素已按值排好序15.设血 a=12;,则执行完语句 a+=a-=a*a;后,a 的值是_。(分数:2.00)A.522B.264C.144D.-26416.在下列叙述中,错误的一条是_。(分数:2.00)A.对关系的描述称为关系模式,一个关系模式对应一个关系的结构B.不同元组对同一个属性的取值范围称为域C.二维表中的行称为属性D.所谓关键字,即属性或属性组合,其值能够惟一标识一个元组17.下列程序中,正确的为_。(分数:2.00)A.m

4、ain() int *pb= float 1=15.25; print f(“%d/n“ ,*p; B.amin() int a,*pa; a=10; *pa=a; prinffC%d“,*p; C.main() char s20; char *ps= scanf(“%s“,*; printf(“%s“,*; D.main() char str10; int *ps=str0; str=“abcdefg“; printf(“%s“,*; 18.下列程序的输出结果是_。 main() int k=17; printf(“%d,%0,%x /n“,k,k,k); (分数:2.00)A.17,021

5、0x11B.17,17,17C.17,Ox11,021D.17,21,1119.下列描述中,正确的一条是_。(分数:2.00)A.关系表达式的值是一个逻辑值,即“真”或“假”,可以赋给一个逻辑变量B.在 C 语言中,判断一个量是否为:真”时,以 0 代表“假”,以 1 代表“真”C.设 a=3、b=4、c=5,则表达式!(x= (分数:4.00)填空项 1:_39.下列程序的功能是计算机一元二次方程的根。 #includeU 【10】 /U #include stdio.h main ( ) float a, b, c, disc, x1, x2, realpart, imagpart; s

6、canf(“%f%f%f“, printf(“The equation“); if(U 【11】 /U=1e-6) printf(“ is not quadratic/n“); else disc=b*b-4*a*c; if (fabs (disc) =1e-6) printf(“has two equal roots:%-8.4f/n“,-b/(2*a); else if(U 【12】 /U) x1= (-b+sqrt (disc)/(2*a); x2= (-b-sqrt (disc)/(2*a); printf(“has distinct real roots:%8.4f and %.4f

7、/n“,xl,x2); else realpart=-b/(2*a); imagpart=sqrt (-disc)/(2*a); printf(“has complex roots:/n“); printf (“%8.4f+%. 4fi/n“, realpart, imagpart); printf (“%8.4f-%. 4fi/n“, realpart, imagpart); (分数:4.00)填空项 1:_40.下列程序的功能是计算机平均成绩并统计 90 分以上的人数。 main ( ) int n,m; float grade, average; average=n=m=U 【13】 /

8、U; while(U 【14】 /U) scanf(“%f“, if (grade0) break; m+; average+=grade; if (grade90)U 【15】 /U; m+; ) if(n) printf(“%.2f %d/n“,average/n,m); (分数:4.00)填空项 1:_二级 C 语言笔试 45 答案解析(总分:100.00,做题时间:90 分钟)一、B选择题/B(总题数:30,分数:60.00)1.下列各 m 的值中,能使 m%3=2, 则表达式(b2)/(b1)的值是_。(分数:2.00)A.0B.2C.4D.8 解析:7.执行以下语句后的输出结果是_

9、 int x=3,y=0; printf(“%d,%d”,-1x-10 main () int a2 3=1,3,5,7,9,11,*p; p=(int *)malloc(sizeof(int); fur ( printf (“%d/n“, *p); (分数:2.00)A.1B.7C.9 D.11解析:9.下列程序的输出结果为_。 main ( ) int p, y=0, x=0; p=x8 | y8; printf(“%d “,p); p+=(p+=2); printf(“%d/n“,p); (分数:2.00)A.-1 0B.0 0C.0 4D.-1 2 解析:10.若有以下调用语句,则不

10、正确的 fun 函数的首部是_。 main() int a50,n; fun(n, do ai=y%2;i+; y=y/2; while(y=1); for(j=i-1;j=0;j-)printf(“%d“,aj); printf(“/n“); (分数:2.00)A.1000B.10010 C.00110D.10100解析:14.进行二分法查找,则线形表_。(分数:2.00)A.必须以顺序方式存储B.必须以链接方式存储,且数据元素已按值排好序C.必须以链接方式存储D.必须以顺序方式存储,且数据元素已按值排好序 解析:15.设血 a=12;,则执行完语句 a+=a-=a*a;后,a 的值是_。(

11、分数:2.00)A.522B.264C.144D.-264 解析:16.在下列叙述中,错误的一条是_。(分数:2.00)A.对关系的描述称为关系模式,一个关系模式对应一个关系的结构B.不同元组对同一个属性的取值范围称为域C.二维表中的行称为属性 D.所谓关键字,即属性或属性组合,其值能够惟一标识一个元组解析:17.下列程序中,正确的为_。(分数:2.00)A.main() int *pb= float 1=15.25; print f(“%d/n“ ,*p; B.amin() int a,*pa; a=10; *pa=a; prinffC%d“,*p; C.main() char s20; c

12、har *ps= scanf(“%s“,*; printf(“%s“,*; D.main() char str10; int *ps=str0; str=“abcdefg“; printf(“%s“,*; 解析:18.下列程序的输出结果是_。 main() int k=17; printf(“%d,%0,%x /n“,k,k,k); (分数:2.00)A.17,021,0x11B.17,17,17C.17,Ox11,021D.17,21,11 解析:19.下列描述中,正确的一条是_。(分数:2.00)A.关系表达式的值是一个逻辑值,即“真”或“假”,可以赋给一个逻辑变量B.在 C 语言中,判断

13、一个量是否为:真”时,以 0 代表“假”,以 1 代表“真”C.设 a=3、b=4、c=5,则表达式!(x= (分数:4.00)填空项 1:_ (正确答案:void fun (double b1022))解析:39.下列程序的功能是计算机一元二次方程的根。 #includeU 【10】 /U #include stdio.h main ( ) float a, b, c, disc, x1, x2, realpart, imagpart; scanf(“%f%f%f“, printf(“The equation“); if(U 【11】 /U=1e-6) printf(“ is not qua

14、dratic/n“); else disc=b*b-4*a*c; if (fabs (disc) =1e-6) printf(“has two equal roots:%-8.4f/n“,-b/(2*a); else if(U 【12】 /U) x1= (-b+sqrt (disc)/(2*a); x2= (-b-sqrt (disc)/(2*a); printf(“has distinct real roots:%8.4f and %.4f/n“,xl,x2); else realpart=-b/(2*a); imagpart=sqrt (-disc)/(2*a); printf(“has

15、complex roots:/n“); printf (“%8.4f+%. 4fi/n“, realpart, imagpart); printf (“%8.4f-%. 4fi/n“, realpart, imagpart); (分数:4.00)填空项 1:_ (正确答案:(10) math.h (11) fabs(a) (12) fabs(disc)1e-6)解析:40.下列程序的功能是计算机平均成绩并统计 90 分以上的人数。 main ( ) int n,m; float grade, average; average=n=m=U 【13】 /U; while(U 【14】 /U) scanf(“%f“, if (grade0) break; m+; average+=grade; if (grade90)U 【15】 /U; m+; ) if(n) printf(“%.2f %d/n“,average/n,m); (分数:4.00)填空项 1:_ (正确答案:(13) 0 (14) 1 (15) continue)解析:

展开阅读全文
相关资源
猜你喜欢
  • ETSI TR 182 010-2010 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Peer-to-peer for content delivery for IPTV services analysis .pdf ETSI TR 182 010-2010 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Peer-to-peer for content delivery for IPTV services analysis .pdf
  • ETSI TR 182 010-2010 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Peer-to-peer for content delivery for IPTV services analysis _1.pdf ETSI TR 182 010-2010 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Peer-to-peer for content delivery for IPTV services analysis _1.pdf
  • ETSI TR 182 013-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Bearer Control Stage 2 Requirements《电信和互联网融合业务及高级网络协议(TISPAN).pdf ETSI TR 182 013-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Bearer Control Stage 2 Requirements《电信和互联网融合业务及高级网络协议(TISPAN).pdf
  • ETSI TR 182 013-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Bearer Control Stage 2 Requirements《电信和互联网融合业务及高级网络协议(TISPAN)_1.pdf ETSI TR 182 013-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Bearer Control Stage 2 Requirements《电信和互联网融合业务及高级网络协议(TISPAN)_1.pdf
  • ETSI TR 182 015-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Next Generation Networks Architecture for Control of Processi.pdf ETSI TR 182 015-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Next Generation Networks Architecture for Control of Processi.pdf
  • ETSI TR 182 015-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Next Generation Networks Architecture for Control of Processi_1.pdf ETSI TR 182 015-2006 Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN) Next Generation Networks Architecture for Control of Processi_1.pdf
  • ETSI TR 182 017-2007 Telecommunications and Internet Converged Services and Protocols for Advanced Networking (TISPAN) Direct Communication Service Architecture and Functional Desc.pdf ETSI TR 182 017-2007 Telecommunications and Internet Converged Services and Protocols for Advanced Networking (TISPAN) Direct Communication Service Architecture and Functional Desc.pdf
  • ETSI TR 182 017-2007 Telecommunications and Internet Converged Services and Protocols for Advanced Networking (TISPAN) Direct Communication Service Architecture and Functional Desc_1.pdf ETSI TR 182 017-2007 Telecommunications and Internet Converged Services and Protocols for Advanced Networking (TISPAN) Direct Communication Service Architecture and Functional Desc_1.pdf
  • ETSI TR 182 022-2007 Telecommunications and Internet Converged Services and Protocols for Advanced Networking (TISPAN) Architectures for QoS handling《电信和互联网融合业务及高级网络协议(TISPAN) QoS的.pdf ETSI TR 182 022-2007 Telecommunications and Internet Converged Services and Protocols for Advanced Networking (TISPAN) Architectures for QoS handling《电信和互联网融合业务及高级网络协议(TISPAN) QoS的.pdf
  • 相关搜索

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

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