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

C语言全部题目及答案

C语言全部题目及答案_第1页
1/16
C语言全部题目及答案_第2页
2/16
C语言全部题目及答案_第3页
3/16
C 语言全部题目及答案Exercise 1: Programming Environment and Basic Input/Output1. Write a program that prints “This is my first program!” on the screen、 (a) Save this program onto your own disk with the name of e2-1a;(b) Run this program without opening Turbo C;(c) Modify this program to print “This is my second program!”, then save it as e2-1b、 Please do not overwrite the first program、2. Write a program that prints the number 1 to 4 on the same line 、 Write the program using the following methods:(a) Using four “printf” statements、(b) Using one “printf” statement with no conversion specifier (i、e、 no ‘%’)、(c) Using one “printf” statement with four conversion specifiers3.(a) Write a program that calculates and displays the number of minutes in 15 days、 (b) Write a program that calculates and displays how many hours 180 minutes equal to、 (c) (Optional) How about 174 minutes?ANSWERS:#includeint main(){printf("This is my first program!");return 0;}#includeint main(){printf("This is my second program!");return 0;}#includeint main(){printf("1");printf("2");printf("3");printf("4");return 0;}#includeint main(){printf("1234");return 0;}#includeint main(){printf("%d%d%d%d",1,2,3,4);return 0;}#includeint main(){float days,minutes;days = 15;minutes = days * 24 * 60;printf("The number of minutes in 15 days are %f\n", minutes);return 0;}#includeint main(){float minutes,hours;minutes = 180;hours = minutes / 60;printf("180 minutes equal to %f hours\n", hours);return 0;}#includeint main(){float minutes,hours;minutes = 174;hours = minutes / 60;printf("174 minutes equal to %f hours\n", hours);return 0;}Exercise 2: Data Types and Arithmetic Operations1、 You purchase...

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

碎片内容

C语言全部题目及答案

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