资源描述:
《c语言函数章节选择题》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.在C语言中,全局变量的存储类别是:A)staticB)externC)voidD)registerA2.C语言中,凡未指定存储类别的局部变量的隐含存储类别是:A)自动(auto)B)静态(static)C)外部(extern)D)寄存器(register)A3.在一个C源程序文件中,要定义一个只允许本源文件中所有函数使用的全局变量,则该变量需要使用的存储类别是:________。A)externB)registerC)autoD)staticD4.若有以下调用语句,则正确的fun函数首部是main(){∶∶inta;floatx;∶∶fun(x,a);∶
2、∶}A)voidfun(intm,floatx)B)voidfun(floata,intx)C)voidfun(intm,floatx[])D)voidfun(intx,floata)B5.有如下函数调用语句func(rec1,rec2+rec3,(rec4,rec5));该函数调用语句中,含有的实参个数是A)3B)4C)5D)有语法错误A6.以下程序的运行结果是。#includemain(){intk=4,m=1,p;p=func(k,m);printf("%d,",p);p=func(k,m);printf("%d",p);}fun
3、c(inta,intb){staticintm=0,i=2;i+=m+1;m=i+a+b;returnm;}A)8,17,B)8,17forthequalityofreviewsandreview.Article26threview(a)theCCRAcompliance,whethercopiesofchecks;(B)whetherdoubleinvestigation;(C)submissionofprogramcompliance,investigationorexaminationofwhetherviewsareclear;(D)theborro
4、wer,guarantorloansC)8,8D)4,1B7.函数fun的功能是:根据以下公式计算S,n通过形参传入,n的值大于等于0。划线处应填________。1111S=1-─+─-─+…───3572n-1floatfun(intn){floats=0.0,w,f=-1.0;inti=0;for(i=0;i<=n;i++){________;w=f/(2*i+1);s+=w;}returns;}A)f=1B)f=-1C)f=-1*fD)f=0C8.函数fun的功能是:根据以下公式计算并返回S,n通过形参传入,n的值大于等于0。划线处应填_______
5、_。1111S=1-─+─-─+…───3572n-1floatfun(intn){floats=0.0,w,t,f=-1.0;inti;for(i=0;i6、______。A)12B)13C)14D)15forthequalityofreviewsandreview.Article26threview(a)theCCRAcompliance,whethercopiesofchecks;(B)whetherdoubleinvestigation;(C)submissionofprogramcompliance,investigationorexaminationofwhetherviewsareclear;(D)theborrower,guarantorloansD10.有如下程序intfunc(inta,intb
7、){return(a+b);}main(){intx=2,y=5,z=8,r;r=func((x-y),z);printf("%d",r);}该程序的输出结果是__________。A)10B)13C)5D)15C11.以下函数返回a数组中最小值所在的下标,在划线处应填入的是________。fun(inta[],intn){inti,j=0,p;p=j;for(i=j;i8、式求π值:(π*π)/6=1+1/(2*2)+1/(