- 1、本文档共17页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
- 二手车鉴定与评估3分析.ppt
- 二次函数y=ax^2+bx+c的图像与性质分析.ppt
- 二模试卷分析分析.doc
- 二次函数y=a(x-h)^2的图像与性质分析.ppt
- 二年级上册第9课动物造型饼干(浙美版)分析.ppt
- 二次回路基础知识分析.pptx
- 二次直流系统分析.ppt
- 二战德国战斗机分析.ppt
- 二次结构冬季施工方案分析.doc
- 二氧化氯发生器原理分析.doc
- 2024年中国钽材市场调查研究报告.docx
- 2024年中国不锈钢清洗车市场调查研究报告.docx
- 2024年中国分类垃圾箱市场调查研究报告.docx
- 2024年中国水气电磁阀市场调查研究报告.docx
- 2024年中国绿藻片市场调查研究报告.docx
- 2010-2023历年初中毕业升学考试(青海西宁卷)数学(带解析).docx
- 2010-2023历年福建厦门高一下学期质量检测地理卷.docx
- 2010-2023历年初中数学单元提优测试卷公式法(带解析).docx
- 2010-2023历年初中毕业升学考试(山东德州卷)化学(带解析).docx
- 2010-2023历年初中毕业升学考试(四川省泸州卷)化学(带解析).docx
文档评论(0)