资源描述:
《西交《程序设计基础(高起专)》在线作业》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、西交《程序设计基础(高起专)》在线作业Westernexchange^programdesignfoundation(hightechnicalspecialty)onlinehomeworkTestscores:100testtime:一testscores:100One,singletopic(50questions,100points)・Score:100Thefollowingstatementistrue()YoucandefinedefineandifasAuseridentifierYouc
2、andefinedefineasauseridentifier,butyoucan,tdefineanifasauseridentifierC.youcandefinetheifasauseridentifier,butyoucan,tdefinedefineasauseridentifierD.defineandifarenotdefinedasuseridentifiersAnswer:BAscoreof2points:2Theoutputofthefollowingprogramis()main()
3、{inta=4,b=5,c二0,d;D=!A&&!B
4、
5、!C;Printf(〃%d“,d);}1A.B.0B.thenumberofnon一zeroC.1Answer:A,Ascoreof2points:2Ifthepointerpiscorrectlydefined,theincorrectstatementis()tomaketheppointtotwoconsecutiveintegerdynamicstorageunits・A.p=2*(int*)malloc(int);B.p二(int*)m
6、alloc(2*sizeof(int));C.P二(int*)malloc(2*2);D.P二(int*)calloc(2,sizeof(int));Answer:A,Ascoreof2points:2Whatisincorrectabouttheswitchstatementis()TheorderofA.CasedoesnotaffecttheexecutionresultTheconstantsinthebackofeachcasestatementcanbedifferentAfterexecut
7、ingacasestatement,thenextcasestatementisexecutedTheexpressionaftereachcasestatementcanonlybeconstantAnswer:BAscoreof2points:25.A:x二9;Y二++x;Theresultis()A.x二9.Y二9;B.x二10;Y二10;C・x二9.Y二10;D.x二10;Y二9;Answer:BAscoreof2points:2WhenitcomestoPointers,thefollowing
8、statementisfalse()A.ThepointervariableisusedtoholdthememoryaddressB.&meansthevariableaddressoperationC.*indicatestheoperationofthevariablecontentthatthepointervariablepointstoD.CanassignanintegertoapointervariableAnswer:DAscoreof2points:2Thefollowingstate
9、mentisfalse()A.elseisalwaysontopofitTheconditionalexpressioncanbeenclosedinparentheses・ThewholeifstatementisconsideredastatementintheprogramThestatementsinthed.ifstatementcanbeeitherastatementoracompoundstatementAnswer:BAscoreof2points:2Whichofthefollowin
10、gisnotthefeatureofthealgorithm()A.havepoorsexB.thefeasibilityuncertaintyD.inputAnswer:CAscoreof2points:2Thefollowingexpression:intI,*IP二&Iiscorrect()A.thisexpressioniswrongThisexpressionindicatesthattheIPisinitializ