C程序设计主讲刘怀亮:完美解析选择结构实例程序【PPT】
82 浏览量
更新于2024-04-11
收藏 463KB PPT 举报
The C language program design presentation titled "C语言程序设计No第章程序设计完美版资料.ppt" discusses the concept of program design in C programming. The fifth lecture, presented by Liu Huailiang from the Information Management Department of the School of Economics and Management, introduces the topic of selection structures in C program design.
The lecture begins with an example that involves calculating the value of the function sin(x)/x where x is not equal to zero and y is equal to 1 when x equals zero. The necessary steps for this calculation are outlined, including inputting the value of x, determining the value of x, calculating the value of y based on x, and finally outputting the value of y.
It is pointed out that the use of only sequential structures cannot achieve this calculation, and thus the introduction of selection structures becomes necessary. The sample code provided includes the necessary header files and defines a main function that prompts the user to input the value of x, reads the input, carries out the required calculations, and outputs the value of y.
In conclusion, the lecture emphasizes the importance of selection structures in C program design for scenarios that involve making decisions based on certain conditions. The example provided serves as a practical illustration of how selection structures can be used to solve problems in program design. The presentation serves as a valuable resource for those interested in mastering C programming and improving their program design skills.
xinkai1688
- 粉丝: 376
- 资源: 8万+
最新资源
- Aspose资源包:转PDF无水印学习工具
- Go语言控制台输入输出操作教程
- 红外遥控报警器原理及应用详解下载
- 控制卷筒纸侧面位置的先进装置技术解析
- 易语言加解密例程源码详解与实践
- SpringMVC客户管理系统:Hibernate与Bootstrap集成实践
- 深入理解JavaScript Set与WeakSet的使用
- 深入解析接收存储及发送装置的广播技术方法
- zyString模块1.0源码公开-易语言编程利器
- Android记分板UI设计:SimpleScoreboard的简洁与高效
- 量子网格列设置存储组件:开源解决方案
- 全面技术源码合集:CcVita Php Check v1.1
- 中军创易语言抢购软件:付款功能解析
- Python手动实现图像滤波教程
- MATLAB源代码实现基于DFT的量子传输分析
- 开源程序Hukoch.exe:简化食谱管理与导入功能