浙江大学c程2004A试卷E

浙江大学c程2004A试卷E

ID:37773778

大小:73.00 KB

页数:8页

时间:2019-05-30

浙江大学c程2004A试卷E_第1页
浙江大学c程2004A试卷E_第2页
浙江大学c程2004A试卷E_第3页
浙江大学c程2004A试卷E_第4页
浙江大学c程2004A试卷E_第5页
资源描述:

《浙江大学c程2004A试卷E》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、浙江大学2004-2005学年冬季学期《CProgramming》课程期末考试试卷开课学院:计算机学院,考试形式:闭卷考试时间:2005年1月22日,所需时间:120分钟考生姓名:学号:专业:(注意:答题内容必须写在答题卷上,写在本试题卷上无效)Section1:SingleChoice(2markforeachitem,total20marks)1.Theprecedenceofoperator_____isthelowestone.A.?:B.==C.+=D.&2._____iscorrectifitisusedasacharacterconstant.A.’

2、’B.'80'C.'%d'D.0xa3.Accordingtothedeclaration:charc1=92,c2=92;thevalueofexpression_____is0.A.c1^c2B.c1&c2C.~c2D.c1

3、c24.Accordingtothedeclaration:intx=11;thevalueofexpression(x++*1/3)is_____.A.3B.4C.0 D.3.6675.Thevalueofexpressionsizeof("um=%dt")is______.A.7B.8C.9D.106.Inthefollo

4、wingassignmentsorinitialization,______iswrong.A.chars[]="hello";B.chars[10];s="hello";C.char*p="hello";D.char*p;p="hello";7.Thefollowingcodefragmentprintsout______.#defineMA(x,y)(x)*(y)inti=2;i=3/MA(i,i+2)+5;printf(“%d”,i);A.5B.8C.9D.118.staticstruct{intx,y[3];}a[3]={{1,2,3,4},{5,6,

5、7,8},{9,10,11,12}},*p;p=a+1;Thevalueofexpression*((int*)(p+1)+2)is______.A.3B.7C.10D.119.Afterrunningthefollowingcodefragment,thevalueofsis______.inti=5,s=0;《CProgramming》TESTPAPER,Jan22,20058/8doif(i%2)continue;elses+=i;while(--i);A.15B.9C.6D.51.Accordingtothedeclaration:int(*p)[10],

6、pisa(n)______.A.pointerB.arrayC.functionD.elementofarraySection2:Fillintheblanks(2markforeachitem,total30marks)1.Thevalueofexpression1+4/5+15<7+4%5+(8,10)is___1___.2.Thevalueofexpression!!10is__1___.3.Thevalueofexpression3>2>1is__0___.4.Thevalueofexpression~(-1<<1)is__1____.5.Thestate

7、mentfor(i=1;i<=9;i++)printf(“%3d”,_3*i-2_____);printsoutthefollowingnumbers:147101316192225.6.Accordingtothedeclaration:inta[10],*p=&a[1]+2;thelastelementofarrayaisp[_6_].7.Writethedeclaration_____withtypedef,whichmakesPAasynonymforacharacterpointerarray,whichcontains100elements.typed

8、efchar*PA[100];8.Thefollowingcodefragmentprintsout___5__.staticinta[3][4]={{1,2,3},{4,5,6}};printf(“%d”,a[0][5]);9.Thefollowingcodefragmentprintsout__45,3___.chara[]={“678”,”45”},**p=a+1;printf(“%s,%c”,*p,**p-1);10.Thefollowingcodefragmentprintsout__2___.int*p,*q,k=1,j=10;p=&j;q=&k;p=

9、q;(*p

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

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

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