资源描述:
《浙江科技学院2014学年第二学期C语言期末试卷.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、浙江科技学院考试科目C语言程序设计考试方式闭卷完成时限2小时拟题人陈梦涛审核人批准人2015年6月28日土木与建筑工程学院2014年级土木工程国际班专业Importantnote::1.Youranswersmustbewrittenontheanswersheet;2.If answersheet ofpaper is notenough, pleasewrite ontheback,donot add another roll;3. Papers mustbe returned withthe answersheet atthesametimewhenexamina
2、tion iscomplete.Ⅰ.Choosetherightanswer(2marksforeachitem,totalmarks:40). 1.Determinetheoutputofthefollowingstatement:printf("%d",'M'-'N');A)'M'-'N'B)M-NC)3D)-12.Whichoffollowingisanillegaluser-definesymbol?A)scanfB)_123C)C$D)var3.WhichstatementisnotaCstatement?A){inta;a++;}B)z=20,a+=c;C)
3、;D){;}4.Whichoperatorcanonlybeappliedtointegers? A)%=B)/C)=D)<=5.Determinetheoutputofthefollowingprogram.voidmain(){inty=8,x=7; printf("%d%d",++x,y++);} A)7,8B)9,7C)8,8D)8,96.Choosethewrongdefinitionforthecharacterstrings. A)charstr[4]=“QUST”; B)charstr[]=“QUST”;C)char*str=“QUST”; D)c
4、harstr[]={‘Q’,‘U’,‘S’,‘T’,‘ ’};7.Determinetheoutputofthefollowingprogram.voidmain() {inti,j,m=0; for(i=1;i<=15;i+=5)for(j=3;j<=19;j+=3)m++;}printf("%d",m); A)12 B)15 C)18 D)258.Forthe2-dimensionalarrayintb[][3]={{1,0,-1},{10,12},{8,3,9},{0}};thevaluefortheb[2][1]is______.A)8B)5C)3
5、D)129.Inthestatementwhile(x),choosetheequivalentexpressionforthex.A)x==0 B)x==1 C)x!=1 D)x!=010.Forthefollowingcodes:intz=5,*p=&z;thevalueofthe*pis_______.A)theaddressofc B)unknownvalue C)theaddressofp D)511.Inordertoassign45tovariantaandassign64tovariantbwiththestatementscanf(“%d%d”,&a,
6、&b),whichinputformatiscorrect?A)4564 B)45,64C)45;64D)456412.Whatisthebytelengthofthestring“t\abcd”.A)6B)7C)8D)913.Determinetheoutputofthevalueofb.Inta[4][2]={1,2,3,4,5,6,7,8};b=*(*(a+2)+1); A)3 B)4 C)5 D)614.Determinetheoutputofthefollowingprogram:main(){intn=8;while(n>5){n--;printf(“
7、%d”,n);}}A)876 B)765 C)8765D)765415.Thereis thedefinition statement "chars[]="***";", aftertheexecution ofthe followingstatement, outputwillbe ().char*p;for(p=s;p