期末试卷高级语言程序设计_(b卷)

期末试卷高级语言程序设计_(b卷)

ID:13100841

大小:102.00 KB

页数:8页

时间:2018-07-20

期末试卷高级语言程序设计_(b卷)_第1页
期末试卷高级语言程序设计_(b卷)_第2页
期末试卷高级语言程序设计_(b卷)_第3页
期末试卷高级语言程序设计_(b卷)_第4页
期末试卷高级语言程序设计_(b卷)_第5页
资源描述:

《期末试卷高级语言程序设计_(b卷)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、试卷编号:(B)卷课程编号:课程名称:高级语言程序设计考试形式:闭卷适用班级:姓名:学号:班级:学院:专业:考试日期:题号一二三四五六七八九十总分累分人签名题分404020100得分考生注意事项:1、本试卷共8页,请查看试卷中是否有缺页或破损。如有立即举手报告以便更换。2、考试结束后,考生不得将试卷、答题纸和草稿纸带出考场一、FundamentalConceptsofC(40Points).得分评阅人1.(3Points)ThefollowingCprogramiscompiledandrunssuccessf

2、ully. Writetheoutputthatthisprogramproduces. #includemain(){inta;floatb; a=7.0/3.0;printf(“%d”,a); a=9%4;printf(“%d”,a);b=4+7.0/2;printf(“%.1f”,b);}第8页共8页2.(4Points)ThefollowingCprogramiscompiledandrunssuccessfully. Writetheoutputthatthisprogr

3、amproduces. #includemain(){intx=4;inty=4;if((x<=y)&&(x>=y))      printf(“Bingo”);else      printf(“Nogo”);}3.(6points)Variablesa,b,andcareintegerswherea=3,b=4andc=5respectively.DothefollowingCexpressionsevaluatetotrueorfalse?Youanswersshouldbeeither

4、trueorfalse. a)a

5、

6、b+c&&b==cb)!(x=a)&&(y=b)&&0c)!(a+b)+c-1&&b+c/24.(4Points)Thecodefragment(below)hasanerror.Changeonecharactertoremovetheerror. inttotal[15];intfactor1[15];intfactor2[15];inti; for(i=0;i<=15;i++)total[i]=factor1[i]+factor2[i]+factor2[i/2];5.(

7、8Points)ThefollowingCprogramiscompiledandrunssuccessfully.Writetheoutputthefollowingprogramproduces.#include#defineNRows8main(){inti,j;for(i=1;i<=NRows;i++){for(j=0;j

8、derscontainerrors?Circletheerrorsandgivethecorrectfunctionheader.. (a.) doubleminimum(floata;floatb)  (b.)floataverage(intx,y)  (c.)voidproduct(inta,intb); 7.(4Points)Thefollowingcodecontainsaloop.RewritetheloopusingaFORinsteadofaWHILE,keepingtheoutputthesam

9、e.Also,whatistheoutputoftheprogram? #include main(){intn;intmult=1; n=1;while(n<5){mult=mult*n;n++;} printf("Answeris%d",mult);}8.  (2points)ThefollowingCprogramiscompiledandrunssuccessfully.Writetheoutputthefollowingprogramproduces. #include

10、o.h>main(){intk=8printf("%d",k++);printf("%d",++k); }9.(3points)AssumewehavedeclaredthetwodimensionalarrayAintheClanguage, inta[3][4];Whichoneisincorrecttorefertotheelementofthearray?a)a[0][

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

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

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