c语言-课后题答案(c language - answers to questions after class)

c语言-课后题答案(c language - answers to questions after class)

ID:12714671

大小:31.41 KB

页数:50页

时间:2018-07-18

c语言-课后题答案(c language - answers to questions after class)_第1页
c语言-课后题答案(c language - answers to questions after class)_第2页
c语言-课后题答案(c language - answers to questions after class)_第3页
c语言-课后题答案(c language - answers to questions after class)_第4页
c语言-课后题答案(c language - answers to questions after class)_第5页
资源描述:

《c语言-课后题答案(c language - answers to questions after class)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、c语言-课后题答案(Clanguage-answerstoquestionsafterclass)Clanguage-after-schoolexercisesanswer:Chapter11.,pleaserefertothischapterexamples,writeaCprogram,outputthefollowinginformation:**************************Verygood!**************************Solution:#includeVoid,main(){Printf("************

2、**************");Printf("");Printf("Verygood,");Printf("");Printf("**************************");}2.writeaCprogram,inputa,B,Cthreevalues,outputthemaximumvalue.Solution:#includeVoid,main(){Int,a,B,C,max;Printf(enterthreenumbersa,B,c:);Scanf("%d,%d,%d",&a,&b,&c);Max=a;If(max

3、=b;If(max#

4、includeVoid,main(){Double,P,r=0.1,n=10;P=pow((1+r),n);Printf("%lf",P);}3.asktheprogramtotranslate"China"intoapassword,andthedecodingruleistoreplacetheoriginalletterwiththefourthlettersbehindtheoriginalletter.Forexample,thefourthletterbehindtheletter"A"is"E","E"insteadof"A"".Therefore,

5、"China"shouldbetranslatedas"Glmre"".Pleasewriteaprogram,withthemethodoftheinitialvalueofCl,C2,C3,C4,C5valuesoffivevariableswere'C','H','i','n','a',C1,C2afteroperation,C3,C4,C5,'l'and'G'respectivelyinto'm','r','e',andoutput.Solution:#includeVoid,main(){Charc1='C',c2='h',c3='i',c4='n',c5

6、='a';C1+=4;C2+=4;C3+=4;C4+=4;C5+=4;Printf("passwordis%c%c%c%c%c",C1,C2,C3,C4,C5);}Thirdchapters3.inputdatawiththefollowingscanffunctiontomakea=3,b=7,x=8.5,y=71.82,c1='A',c2='a'.HowdoItypeonthekeyboard?Solution:#includeVoidmain(){Int,a,B,float,x,y,char,C1,c2;Scanf("a=%d,b=%d",&a,&b);S

7、canf("x=%f","y=%e","&x","&y");Scanf("c1=%c","c2=%c","&c1","&c2");}A=3,b=7X=8.5,y=71.82C1=A,c2=a5.circleradiusr=1.5,cylinderh=3,findtheperimeterandareaofacircle,spheresurfacearea,volume,volumeofcylindricalball.Scanfinputdata,output

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

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

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