资源描述:
《浙江大学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