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

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

1、二级 C语言笔试-226 及答案解析(总分:102.00,做题时间:90 分钟)一、选择题(总题数:50,分数:62.00)1.关掉计算机的电源后,其中存储的数据立即丢失的存储器是 ( )(分数:1.00)A.软盘B.硬盘C.ROMD.RAM2.下列句子中,正确的 C语言赋值语句是 ( )(分数:1.00)A.n + +;B.ab88C.tint(x+y);D.a100,b2003.以下程序运行后,a 的值是 ( )main( )inta,k4,m6,*pl int k5;char c;DATE;srtuct dateint cat;DATEcow;double dog; too;DATE m

2、ax;则下语句的执行结果是 ( )printf(“%d,“sizeof(struct date)+size of(max);(分数:1.00)A.25B.30C.18D.87.下列语句中符合 C语言语法的赋值语句是 ( )(分数:1.00)A.a7 + b + ca + 7;B.97 + b + 9 + + a + 7;C.a7 + b,b+ +,a + 7;D.a7 + b,ca + 7;8.CPU能够直接访问的存储器是 ( )(分数:1.00)A.软盘B.硬盘C.RAMD.CD-ROM9.在下列各 m的值中,能使 m%32printf(“%d/n“, (x ,以下 fun函数的功能是:在第

3、一个循环中给前 10个数组元素依次赋1、2、3、4、5、6、7、8、9、10;在第二个循环中使 a数组前 10个元素中的值对称拆叠,变成1、2、3、4、5、5、4、3、2、1。请填空fun(int a )int i;for(i1;i10;i+ +) 【13】 i;for(i0;i5;i + +) 【14】 ai;(分数:4.00)填空项 1:_57.下面函数用来求出两个整数之和,并通过形参传回两数相加之和值。请填空。int add(int x,inty, 【15】 ,)【16】 x + y;(分数:4.00)填空项 1:_58.下面 invert函数的功能是将一个字符串 str的内容颠倒过来。

4、请填空。# includestring.hvoid invert(char str )int i,j 【17】 ;for(i0,jstrlen(str) 【18】 ;ij;i+ +,j- -)kstri;stristrj;strjk;(分数:4.00)填空项 1:_59.函数 viod fun(float * sn,int n)的功能是:根据以下公式计算 S,计算结果通过形参指针 sn传回;n通过形参传入,n 的值大于等于 0。请填空。s=1-1/3+1/5-1/7+1/(2n+1)void fun(float * sn,int n)floats0.0,w,f-1.0;int i0;for(i

5、0;in;i+ +)f 【19】 * f;wf/(2i+1);s+ +w;【20】 s;(分数:4.00)填空项 1:_二级 C语言笔试-226 答案解析(总分:102.00,做题时间:90 分钟)一、选择题(总题数:50,分数:62.00)1.关掉计算机的电源后,其中存储的数据立即丢失的存储器是 ( )(分数:1.00)A.软盘B.硬盘C.ROMD.RAM 解析:2.下列句子中,正确的 C语言赋值语句是 ( )(分数:1.00)A.n + +; B.ab88C.tint(x+y);D.a100,b200解析:3.以下程序运行后,a 的值是 ( )main( )inta,k4,m6,*pl i

6、nt k5;char c;DATE;srtuct dateint cat;DATEcow;double dog; too;DATE max;则下语句的执行结果是 ( )printf(“%d,“sizeof(struct date)+size of(max);(分数:1.00)A.25B.30 C.18D.8解析:7.下列语句中符合 C语言语法的赋值语句是 ( )(分数:1.00)A.a7 + b + ca + 7;B.97 + b + 9 + + a + 7;C.a7 + b,b+ +,a + 7;D.a7 + b,ca + 7; 解析:8.CPU能够直接访问的存储器是 ( )(分数:1.00

7、A.软盘B.硬盘C.RAM D.CD-ROM解析:9.在下列各 m的值中,能使 m%32printf(“%d/n“, (x ,以下 fun函数的功能是:在第一个循环中给前 10个数组元素依次赋1、2、3、4、5、6、7、8、9、10;在第二个循环中使 a数组前 10个元素中的值对称拆叠,变成1、2、3、4、5、5、4、3、2、1。请填空fun(int a )int i;for(i1;i10;i+ +) 【13】 i;for(i0;i5;i + +) 【14】 ai;(分数:4.00)填空项 1:_ (正确答案:13ai-114a9-i)解析:57.下面函数用来求出两个整数之和,并通过形参传回

8、两数相加之和值。请填空。int add(int x,inty, 【15】 ,)【16】 x + y;(分数:4.00)填空项 1:_ (正确答案:15int * p16* p或 p0)解析:58.下面 invert函数的功能是将一个字符串 str的内容颠倒过来。请填空。# includestring.hvoid invert(char str )int i,j 【17】 ;for(i0,jstrlen(str) 【18】 ;ij;i+ +,j- -)kstri;stristrj;strjk;(分数:4.00)填空项 1:_ (正确答案:17k18-1)解析:59.函数 viod fun(float * sn,int n)的功能是:根据以下公式计算 S,计算结果通过形参指针 sn传回;n通过形参传入,n 的值大于等于 0。请填空。s=1-1/3+1/5-1/7+1/(2n+1)void fun(float * sn,int n)floats0.0,w,f-1.0;int i0;for(i0;in;i+ +)f 【19】 * f;wf/(2i+1);s+ +w;【20】 s;(分数:4.00)填空项 1:_ (正确答案:19-1 或-1.0 或-120 * sn)解析:

展开阅读全文
相关资源
猜你喜欢
  • BS PD IEC TS 62763-2013_5284 Pilot function through a control pilot circuit using PWM (pulse width modulation) and a control pilot wire《通过控制导向线使用PWM (脉冲宽度调制) 的导向功能和控制导向线》.pdf BS PD IEC TS 62763-2013_5284 Pilot function through a control pilot circuit using PWM (pulse width modulation) and a control pilot wire《通过控制导向线使用PWM (脉冲宽度调制) 的导向功能和控制导向线》.pdf
  • BS ISO 8070-2007 Milk and milk products - Determination of calcium sodium potassium and magnesium contents - Atomic absorption spectrometric method《牛奶和奶制品 钙、钠、钾和镁含量的测定 原子吸.pdf BS ISO 8070-2007 Milk and milk products - Determination of calcium sodium potassium and magnesium contents - Atomic absorption spectrometric method《牛奶和奶制品 钙、钠、钾和镁含量的测定 原子吸.pdf
  • BS ISO 8082-1-2009 Self-propelled machinery for forestry - Laboratory tests and performance requirements for roll-over protective structures - General machines《林业用自推进机械 防倾.pdf BS ISO 8082-1-2009 Self-propelled machinery for forestry - Laboratory tests and performance requirements for roll-over protective structures - General machines《林业用自推进机械 防倾.pdf
  • BS ISO 8082-2-2011 Self-propelled machinery for forestry Laboratory tests and performance requirements for roll-over protective structures Machines having a rotating platf.pdf BS ISO 8082-2-2011 Self-propelled machinery for forestry Laboratory tests and performance requirements for roll-over protective structures Machines having a rotating platf.pdf
  • BS ISO 8083-2006 Machinery for forestry - Falling-object protective structures (FOPS) - Laboratory tests and performance requirements《林业机械 落体防护装置(FOPS) 实验室试验和性能要求》.pdf BS ISO 8083-2006 Machinery for forestry - Falling-object protective structures (FOPS) - Laboratory tests and performance requirements《林业机械 落体防护装置(FOPS) 实验室试验和性能要求》.pdf
  • BS ISO 8086-2004 Dairy plant - Hygiene conditions - General guidance on inspection and sampling procedures《乳品厂 卫生条件 检验和取样程序通用指南》.pdf BS ISO 8086-2004 Dairy plant - Hygiene conditions - General guidance on inspection and sampling procedures《乳品厂 卫生条件 检验和取样程序通用指南》.pdf
  • BS ISO 8096-2005 Rubber- or plastics-coated fabrics for water resistant clothing - Specification《雨衣用橡胶或塑料涂覆织物 规范》.pdf BS ISO 8096-2005 Rubber- or plastics-coated fabrics for water resistant clothing - Specification《雨衣用橡胶或塑料涂覆织物 规范》.pdf
  • BS ISO 8097-2001 Aircraft Minimum airworthiness requirements and test conditions for certified air cargo unit load devices《航空器 经认证的航空货运集装单元装置最低适航性要求和试验条件》.pdf BS ISO 8097-2001 Aircraft Minimum airworthiness requirements and test conditions for certified air cargo unit load devices《航空器 经认证的航空货运集装单元装置最低适航性要求和试验条件》.pdf
  • BS ISO 8114-1993 Textile machinery and accessories - Spindles for ring-spinning and doubling machines - List of equivalent terms《纺织机械和附件 环锭纺纱机和并线机用锭子 同义术语表》.pdf BS ISO 8114-1993 Textile machinery and accessories - Spindles for ring-spinning and doubling machines - List of equivalent terms《纺织机械和附件 环锭纺纱机和并线机用锭子 同义术语表》.pdf
  • 相关搜索

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

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