电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

C语言全部题目及答案

C语言全部题目及答案_第1页
1/24
C语言全部题目及答案_第2页
2/24
C语言全部题目及答案_第3页
3/24
C 语言全部题目及答案Exercise 1: Programmi ng En vir onment and Basic In put/Output1. Write a program that prints “This is my first program!on the screen.(a) Save this program on to your own disk with the n ame of e2-1a;(b) R un this program without ope ning Turbo C;(c) Modify this program to print “This is my second program” , then save it as1 to 4 on theWsame lineogWrmtehaheprints the nu mberusing the followi ng methods:(a) Using four “ printf stateme nts.(b) Usings。(c)Using one3. (a) Write a program that acalculates and displays the number of minutes in 15 days.(b) Writeprogram that calculates and displays how manyhours 180 minutes equale2-1b. Please do not overwrite the first program.to.(c) (Optional) How about 174 minutesN?SWERS:program“printf stateme nt with noconv ersi on specifier (i.e. no '% ).“printf statement with four conversion specifiers#i ncludeint mai n()(prin tf("This is my firstprogram!");return 0;}#i ncludeint mai n()(prin tf("This is my sec ondprogram!");return 0;}#i ncludeint mai n()(prin tf("1");prin tf("2");prin tf("3");prin tf("4"); return 0;}#i ncludeint mai n()(prin tf("1234"); return 0;}#i ncludeint mai n()(prin tf("%d%d%d%d",1,2,3,4); return 0;}#in cludeint mai n()(float days, minu tes;days = 15;minu tes = days * 24 *60;prin tf("The nu mber of mtesin 15 daysare %f\n", minu tes);return 0;}#in cludeint mai n()(float minu tes,hours;minu tes = 180;hours = minu tes / 60;prin tf("180 minu tesequal to %f hours\n",hours);return 0;}#in cludeint mai n()(inutes,tes = 174;hours = minu tes / 60;prin tf("174 mi nu tesequal to %f hours\n",hours);return 0;Exercise 2: Data Types and Arithmetic Operati ons1. You purchase a laptop comp...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

C语言全部题目及答案

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部