完整版C语言英文试题.docx

上传人:lao****ou 文档编号:427657 上传时间:2023-11-07 格式:DOCX 页数:3 大小:23.36KB
下载 相关 举报
完整版C语言英文试题.docx_第1页
第1页 / 共3页
完整版C语言英文试题.docx_第2页
第2页 / 共3页
完整版C语言英文试题.docx_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《完整版C语言英文试题.docx》由会员分享,可在线阅读,更多相关《完整版C语言英文试题.docx(3页珍藏版)》请在第一文库网上搜索。

1、2009-2010学年1学期C语言程序设计(C)课程考试试题拟题学院(系):信息科学与技术学院适用专业:信息08级,通信08级拟题人:校对人:(答案写在答题纸上,写在试题纸上无效)I.Choosetherightanswer(30marks).1. Determinetheoutputofthefo11owingstatement:printf(,%du,M-N);A) ,M,-N,B)M-NB) 3D)12. Whichoffo11owingisani11ega1user-definesymbo1?A)scantB)_123C)C$D)var3. WhichstatementisnotaCs

2、tatement?C)inta;a+;B)z=20,a+=c;C);D);4. Whichoperatorcanon1ybeapp1iedtointegers?A)%=B)/C)=D)=5. Determinetheoutputofthefo11owingprogram.voidmain()(inty=8,=7;printf(%d%dn,+,y+);)A)7,8B)9,7C)8,8D)8,96. Choosethewrongdefinitionforthecharacterstrings.O;A)charstr4=QUST;B)charstr=QUST”;C)char*str=QUST;D)C

3、harSM=QUS,T7. Determinetheoutputofthefo11owingprogram.voidmain()(inti,j,m=0;for(i=1;i=15;i+=5)for(j=3;j15C)18D)258. Forthe2-dimensiona1arrayintb3=1,0,-1,10,12,8,3,9,0;theva1uefortheb21is.A)8B)5C)3D)129. Inthestatementwhi1e(x),choosetheequiva1entexpressionforthex.A)x=0B)x=1C)x!=1D)x!=010. Forthefo11o

4、wingcodes:intz=5,*p=&z;theva1ueofthe*pis.A)theaddressofcB)unknownva1ueC)theaddressofpD)511. Inordertoassign45tovariantaandassign64tovariantbwiththestatementscanf(,%d%d”,&a,&b),whichinputformatiscorrect?A)4564B)45,64C)45;64D)456412. Whatisthebyte1engthofthestringutabcd,.A)6B)7C)8D)913. Determinetheou

5、tputoftheva1ueofb.Inta42=1,2,3,4,5,6,7,8);b=*(*(a+2)+1);A)3B4C)5D)614. Determinetheoutputofthefo11owingprogram:main()(intn=8;whi1e(n5)n-;printf(u%d,1n);)A)876B)765C)8765D)765415. Whatisthefunctiona1ityoffunction,rewind,?A) openthefi1eagain;B) returnthe1engthofthefi1eC) pushthepointertotheendofthefi1

6、eD) pushthepointertothebeginningofthefi1eII.Shortanswerquestions.(30marks)1. a.Enumerateworkf1owcontro1methodsinCprogramming1anguage.(5marks)b.Giveasimp1eCprogramtoshowthebasicpartsofaCprogram.(5marks)2. a.Thefo11owingprogramtakesuserinputnumberanddisp1aythemu1tip1icationresu1tof(num+num)inthenext1i

7、neonthescreen,butita1waydisp1aysthewrongresu1t.Determinewheretheerrorsareandwhytheprogramcannevergivethecorrectresu1t.(8marks)#inc1udevoidmain()intnum;printf(Entera1etter:);scanf(%d,num);num=num*num;printf(Theresu1tofnum+numis%d,&num);)b.ModifytheprogramsoitW川disp1aytheproperresu1t.(12marks)III.Writ

8、etheprograms.(40marks)1. Givenanarraya9,fi11awithrandomva1ues,thenwriteasortingmethodtosortthedatainaanddisp1aytheresu1t.(10marks)2. (a)Writeafunctionnamedmin()thataccepts5integersasinput,whichca1cu1atesandreturnsthemaximumva1ueamongthem.The5integernumbersshou1dbearrangeintoanintegerarray,andpassedt

9、othefunctionmin().(5marks)(b)Inc1udethefunctioninaworkingprogram.Makesureyourfunctionisca11edfrommain()andcorrect1yreturnsava1uetomain().Disp1aytheva1uereturnedbymin()inmain().(5marks)3. Writeaprogramthatdec1aresasing1e-dimensiona1arraysnamednum,.Thenumberstobestoredinnumare45,86,12,37,28,113.Sumoddsandevensseparate1y.Fina11y,givetheresu1tsthatwi11bedisp1ayedonthescreen.(10marks)4. Givenafunction:xx10y2x10x10,x203x100x20Writeaprogramtoaccepttheuserinputforx,anddisp1aytheva1ueofy.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 应用文档 > 汇报材料

copyright@ 2008-2022 001doc.com网站版权所有   

经营许可证编号:宁ICP备2022001085号

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有,必要时第一文库网拥有上传用户文档的转载和下载权。第一文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知第一文库网,我们立即给予删除!



客服