【计算机类职业资格】函数(二)及答案解析.doc

上传人:medalangle361 文档编号:1329928 上传时间:2019-10-17 格式:DOC 页数:4 大小:33KB
下载 相关 举报
【计算机类职业资格】函数(二)及答案解析.doc_第1页
第1页 / 共4页
【计算机类职业资格】函数(二)及答案解析.doc_第2页
第2页 / 共4页
【计算机类职业资格】函数(二)及答案解析.doc_第3页
第3页 / 共4页
【计算机类职业资格】函数(二)及答案解析.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、函数(二)及答案解析(总分:13.00,做题时间:90 分钟)一、B选择题/B(总题数:7,分数:7.00)1.有如下程序 int func(int a,int b) return(a+b); main() int x=3,y=6,z=7,r; r=func(func(x,y),z); printf(“%/d/n“,r); 该程序的输出的结果是_。(分数:1.00)A.14B.15C.16D.172.一个源文件中定义的外部变量的作用域为_。(分数:1.00)A.本文件的全部范围B.本程序的全部范围C.本函数的全部范围D.从定义该变量的位置开始至本文件结束3.有如下程序 void f(int x

2、int y) int t; if(xy)t=x;x=y;y=t; main() int a=4,b=3,c=5; f(a,b);f(b,c);f(c,a); print(“%d,%d,%d/n“,a,b,c); 执行后输出结果是_。(分数:1.00)A.3,4,5B.5,3,4C.5,4,3D.4,3,54.以下程序的运行结果是_。 float fun(int x,int y) return(x+y); main() int a=2,b=5,c=8; printf(“%3.1f/n“,fun(int)fun(a+c,b),a-c); (分数:1.00)A.编译出错B.9C.21D.9.05.

3、以下正确的描述是:在 C 语言程序中_。(分数:1.00)A.函数的定义可以嵌套,但函数的调用不可以嵌套B.函数的定义和函数的调用均可以嵌套C.函数的定义和函数的调用均不可以嵌套D.函数的定义不可以嵌套,但函数的调用可以嵌套6.以下程序的输出结果是_。 long fun(n) long s; if(n=1|n=2)s=2; else s=n-fun(n-1);return s; main() printf(“%ld/n“,fun(3); (分数:1.00)A.1B.2C.3D.47.有如下程序 long fib(int n) if(n2)return(fib(n-1)-fib(n-2); el

4、se return(1); main() printf(“%d/n“,fib(5); 该程序的输出结果是_。(分数:1.00)A.-3B.-2C.-1D.0二、B填空题/B(总题数:3,分数:6.00)8.以下程序的运行结果是_。 #includestdio.h func(int a,int b) static int m=1,i=3; i+=m+1; m=i+a+b; return m; main() int k=2,m=3,p; p=func(k,m);printf(“%d,“,p); p=func(k,m);printf(“%d/n“,p); (分数:2.00)填空项 1:_9.fun(

5、int n,int *s) int f1,f2; if(n=1|n=2)*s=1; else fun(n-1, main() int x; fun(6, main() int x; fun(6,&x); printf(“%d/n“,x); 执行上述程序后,输出结果是_。(分数:2.00)填空项 1:_ (正确答案:8)解析:10.下面程序的运行结果是_。 #includestdio.h main() void inc1(); void inc2(); inc1();inc1();inc1(); inc2();inc2();inc2(); void inc1() int x=0; x+; printf(“in inc1 x=%d/n“,x); void inc2() static int x=0; x+; printf(“in inc2 x=%d/n“,x); (分数:2.00)填空项 1:_ (正确答案:in inc1 x=1)解析:in inc1 x=1 in inc1 x=1 in inc2 x=1 in inc2 x=2 in inc2 x=3

展开阅读全文
相关资源
猜你喜欢
  • ITU-T T 90 AMD 2 FRENCH-1996 Characteristics and protocols for terminals for telematic services in ISDN Amendment 2《信息通讯业务在综合业务数字网(ISDN)中的终端的特性及协议 T系列 信息通讯业务的终端设备及协议 修改件2(8号研究组) 9p.pdf ITU-T T 90 AMD 2 FRENCH-1996 Characteristics and protocols for terminals for telematic services in ISDN Amendment 2《信息通讯业务在综合业务数字网(ISDN)中的终端的特性及协议 T系列 信息通讯业务的终端设备及协议 修改件2(8号研究组) 9p.pdf
  • ITU-T T 90 AMD 2 SPANISH-1996 Characteristics and protocols for terminals for telematic services in ISDN Amendment 2《综合业务数字网(ISDN)中信息通信业务终端的特点和协议 T系列 信息通信业务的终端设备和协议 修改件2 9pp》.pdf ITU-T T 90 AMD 2 SPANISH-1996 Characteristics and protocols for terminals for telematic services in ISDN Amendment 2《综合业务数字网(ISDN)中信息通信业务终端的特点和协议 T系列 信息通信业务的终端设备和协议 修改件2 9pp》.pdf
  • ITU-T T 90 AMD 2-1996 Characteristics and Protocols for Terminals for Telematic Services in ISDN - Series T Terminal Equipments and Protocols for Telematic Services Amendment 2 (St.pdf ITU-T T 90 AMD 2-1996 Characteristics and Protocols for Terminals for Telematic Services in ISDN - Series T Terminal Equipments and Protocols for Telematic Services Amendment 2 (St.pdf
  • ITU-T T 90 AMD 3-1998 Characteristics and Protocols for Terminals for Telematic Services in ISDN - Amendment 3 Cause Value for a G4 Fax Fall-Back - Series T Terminals for Telematic.pdf ITU-T T 90 AMD 3-1998 Characteristics and Protocols for Terminals for Telematic Services in ISDN - Amendment 3 Cause Value for a G4 Fax Fall-Back - Series T Terminals for Telematic.pdf
  • ITU-T T 90 FRENCH-1992 CHARACTERISTICS AND PROTOCOLS FOR TERMINALS FOR TELEMATIC SERVICES IN ISDN《信息通讯业务在综合业务数字网(ISDN)中的终端的特性及协议 信息通讯业务的终端设备及协议 修改件1 8号研究组 105pp》.pdf ITU-T T 90 FRENCH-1992 CHARACTERISTICS AND PROTOCOLS FOR TERMINALS FOR TELEMATIC SERVICES IN ISDN《信息通讯业务在综合业务数字网(ISDN)中的终端的特性及协议 信息通讯业务的终端设备及协议 修改件1 8号研究组 105pp》.pdf
  • ITU-T T 90 SPANISH-1992 CHARACTERISTICS AND PROTOCOLS FOR TERMINALS FOR TELEMATIC SERVICES IN ISDN《综合业务数字网(ISDN)中终端和信息通信业务的特点和协议 信息通信业务的终端设备和协议 修改件1 修改件2 13号研究组 105pp》.pdf ITU-T T 90 SPANISH-1992 CHARACTERISTICS AND PROTOCOLS FOR TERMINALS FOR TELEMATIC SERVICES IN ISDN《综合业务数字网(ISDN)中终端和信息通信业务的特点和协议 信息通信业务的终端设备和协议 修改件1 修改件2 13号研究组 105pp》.pdf
  • ITU-T T 90-1992 Characteristics and Protocols for Terminals for Telematic Services in ISDN - Terminal Equipment and Protocols for Telematic Services《(撤消)综合业务数字网(ISDN)上远程信息处理业务使用的终端.pdf ITU-T T 90-1992 Characteristics and Protocols for Terminals for Telematic Services in ISDN - Terminal Equipment and Protocols for Telematic Services《(撤消)综合业务数字网(ISDN)上远程信息处理业务使用的终端.pdf
  • ITU-T U 1 FRENCH-1993 Signalling Conditions to Be Applied in the International Telex Service《国际电报业务中适用的信令状态》.pdf ITU-T U 1 FRENCH-1993 Signalling Conditions to Be Applied in the International Telex Service《国际电报业务中适用的信令状态》.pdf
  • ITU-T U 1 SPANISH-1993 Signalling Conditions to Be Applied in the International Telex Service《国际电报业务中适用的信令状态》.pdf ITU-T U 1 SPANISH-1993 Signalling Conditions to Be Applied in the International Telex Service《国际电报业务中适用的信令状态》.pdf
  • 相关搜索

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

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