云南大学软件学院C语言所有实验代码分析.doc

云南大学软件学院C语言所有实验代码分析.doc

  1. 1、本文档共17页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
云南大学软件学院C语言所有实验代码分析

第二次试验///第三次试验 =====================程序============================ #includestdio.h int main() { /*十进制*/ printf(%d\n,3+4*6); printf(%d\n,3*4/6+6); printf(%d\n,2*3/12*8/4); printf(%d\n,10*(1+7*3)); printf(%d\n, 20-2/6+3); printf(%d\n, 20-2/(6+3)); printf(%d\n, (20-2)/6+3); printf(%d\n, (20-2)/(6+3)); /*9-16显示为小数,保留小数2位,宽度为8*/ printf(%8.2f\n,3.0+4.0*6.0); printf(%8.2f\n,3.0*4.0/6.0+6.0); printf(%8.2f\n,2.0*3.0/12.0*8.0/4.0); printf(%8.2f\n,10.0*(1.0+7.0*3.0)); printf(%8.2f\n,20.0-2.0/6.0+3.0); printf(%8.2f\n,20.0-2.0/(6.0+3.0)); printf(%8.2f\n,(20.0-2.0)/6.0+3.0); printf(%8.2f\n,(20.0-2.0)/(6.0+3.0)); /*17-20显示为字符*/ printf(%c\n, m - 5); printf(%c\n, m + 5); printf(%c\n, G + 6); printf(%c\n, G - 6); /*21-23显示为十进制整数*/ printf(%d\n, b - a); printf(%d\n, g - a + 1); printf(%d\n, g - a + 1); } =======================运行结果==================================== =================================程序========================== #includestdio.h int main () { float Cel,Fah; printf(print a Fah number:); scanf(%f,Fah); Cel=5.0/9.0*(Fah-32); printf(The Cel number is%f\n,Cel); printf(print a Cel number:); scanf(%f,Cel); Fah=32+9.0*Cel/5.0; printf(The Fah number is:%f \n,Fah); return 0; } ============================运行结果========================= 第四次试验 ************************************(1)程序********************************** #includestdio.h int main() { int num1,num2,num3,max,min; printf(please input three numbers:\n); scanf(%d %d %d,num1,num2,num3); max=(num1num2)?num1:num2; min=(num1=num2)?num1:num2; max=(num3max)?num3:max; min=(num3min)?num3:min; printf(max = %d min = %d,max,min); return 0; } **************************************运行结果********************************* **************************************(2)程序********************************* #include stdio.h int main() { int a; float profit,income; printf(Please input the profit:); scanf(%f,profit); a=(profit-1)/100000; switch(a) { case 0

文档评论(0)

yaocen + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档