C程序设计主讲刘怀亮:完美解析选择结构实例程序【PPT】
130 浏览量
更新于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
- 粉丝: 390
- 资源: 8万+
最新资源
- 快捷方式 到 LoadRunner性能测试实战.doc
- 4. Introduction to Objects-1
- 3. Requirements Phase
- pentaho快速启动指南
- 2. Software Life-cycle Model
- Deploying Red5 to Tomcat
- scrum---xp---chinaese
- PL1 Programming Guide
- DHTML 动态网站手册
- CSS 实例基础教程
- SAP与ORACLE比较之技术篇
- ATX电源的工作原理
- 爱立信薪酬体系(PPT)
- 介绍ERP软件售前顾问的书籍《走进售前顾问》
- 学习C++的五十条规则.doc
- 一些面向对象的设计法则