《C Programming》TEST PAPER

《C Programming》TEST PAPER

ID:37911301

大小:57.50 KB

页数:6页

时间:2019-06-02

《C Programming》TEST PAPER_第1页
《C Programming》TEST PAPER_第2页
《C Programming》TEST PAPER_第3页
《C Programming》TEST PAPER_第4页
《C Programming》TEST PAPER_第5页
资源描述:

《《C Programming》TEST PAPER》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、《CProgramming》TESTPAPERTime:8:30-10:30am.June20,2003Importantnote:youranswersmustbewrittenontheanswersheet Section1:SingleChoice(1markforeachitem,total10marks)1.1.       Theprecedenceofoperator_____isthelowestone.A.<

2、.1.03.3.       Theexpression!(x>0

3、

4、y>0)isequivalentto_____.A.!(x>0)&&!(y>0)B.!x>0&&!y>0C.!x>0

5、

6、!y>0D.!(x>0)

7、

8、!(y>0)4.4.       Thevalueofexpression______isn’t0。A.1/2B.!’’C.!EOFD.NULL5.5.       Ifxisafloatvariable,thevalueofexpression(x=10/4)is_____。A.2.5B.2.0C.3D.26.6.       Ifvariablesaredefine

9、dandassignedcorrectly,theexpression______iswrong.A.a&bB.a^bC.&&xD.a,b7.7.       Accordingtothedeclaration:inta[10],*p=a;theexpression______iswrong.A.a[9]B.p[5]C.*p++D.a++8.8.       ______iswrong.A.charstr[10];str="string";B.charstr[]="string";C.char*p="string";D.char*p;p="string";9.9.       Ifall

10、variableshavebeendefinedanddeclaredinthefollowingprogram,allthevariableswhichcanbeusedinfunctionfun()are______.#includevoidfun(intx){staticinty;……return;}intz;voidmain(){inta,b;fun(a);……}A.x,yB.x,y,zC.a,b,y,zD.a,b,x,y,z10.10.   Accordingtothedeclaration:intp[5],*a[5];theexpression______i

11、scorrect.A.p=aB.p[0]=aC.*(a+1)=pD.a[0]=2 Section2:Fillintheblanks(2markforeachitem,total30marks)1.1.       Accordingtothedeclaration:inta[2][3][4],thenumberofelementsofarrayais_____.2.2.       Writingconditionalexpression______tocalculatethevalueofy.1x>0y=0x=0-1x<03.3.       Thevalueofexpression1

12、<10<5is_____.4.4.       Thevalueofexpression~(10<<1)&4is______.5.5.       Thevalueofexpressionsizeof(“hello”)is______.6.6.       Theoutputofthefollowingstatementsis_____.intk,s;for(k=1,s=0;k<10;k++){if(k%2==0)continue;s+=k;}printf("k=%ds=%d",k,s);1.7.       Theoutputofthefollowingstatementsis____

13、_.#defineMM(x,y)(x*y)printf("%d",MM(2+3,15));2.8.       Theoutputofthefollowingstatementsis_____.intk=1,s=0;switch(k){case1:s+=10;case2:s+=20;break;default:s+=3;}printf("k=%ds=%d",k,s);3.9.       Theoutputofthefollowin

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。