- 1、本文档共58页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
A First Book of ANSI CFourth EditionChapter 5RepetitionObjectivesBasic Loop StructuresThe while StatementComputing Sums and Averages Using a while LoopThe for StatementA First Book of ANSI C, Fourth EditionObjectives (continued)Case Studies: Loop Programming TechniquesNested LoopsThe do-while StatementCommon Programming and Compiler ErrorsA First Book of ANSI C, Fourth EditionIntroductionA section of code that is repeated is called a loop, because after the last statement in the code is executed, the program branches, or loops, back to the first statement and starts another repetition through the codeEach repetition is also called an iteration or pass through the loopA First Book of ANSI C, Fourth EditionBasic Loop StructuresConstructing a repeating section of code requires that four elements be present:Repetition statementwhile statementfor statementdo-while statementConditionA statement that initially sets the condition being testedA statement within the repeating section of code that alters the condition so that it eventually becomes falseA First Book of ANSI C, Fourth EditionPretest and Posttest LoopsA First Book of ANSI C, Fourth EditionPretest and Posttest Loops (continued)A First Book of ANSI C, Fourth EditionCounter-Controlled and Condition-Controlled LoopsCounter-controlled loop: the condition is used to keep track of the number of repetitionsAlso known as a fixed-count loopCondition-controlled loop: the tested condition does not depend on a count being achieved, but rather on a specific value being encounteredA First Book of ANSI C, Fourth EditionBasic Loop StructuresA First Book of ANSI C, Fourth EditionThe while StatementThe general form of the while statement iswhile (expression) statement;The transfer of control back to the start of a while statement to reevaluate the expression is known as a program loopThe following is a valid but infinite loop:while (count = 10) printf(%d ,count);A First Book of ANSI C, Fourth EditionThe while Statement (con
您可能关注的文档
- 记承天寺夜游课件比赛.pptx
- 质量管理体系标准中条款之间的关系.pptx
- 水处理实验技术.pptx
- 锁相技术及频率合成.pptx
- 重庆铠恩国际家居名都广播广告投放沟通案.pptx
- 山东省首届家庭厨艺才艺大赛策划案.pptx
- 海滩的上雕塑教学演示.pptx
- 高层建筑逃生常识.pptx
- 春蚕到死丝方尽蜡炬成灰泪始干.pptx
- 绘图软件的使用.pptx
- TSTIC 120083-2023 电化学储能电站电池系统数字化运维服务要求.pdf
- 病虫害防治工作总结.pdf
- TSTIC 120085-2023 船舶拖带服务规范.pdf
- 健身安全课件图片必威体育精装版完整版本.pptx
- (新统编版)语文二年级下册 第六单元 大单元教学计划.docx
- TSTIC 120081-2023 港口与航道工程施工总承包服务规范.pdf
- THEBQIA 304-2024 型钢智能检测设备设计规范.pdf
- 健身房消防培训课件必威体育精装版完整版本.pptx
- 广东省深圳市红山中学2024-2025学年高二(下)第一次段考语文试卷(含答案).docx
- 广东省深圳市建文外国语学校两学部2025届高三下学期二模物理试题(含答案).docx
文档评论(0)