博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
while和do while循环之间的区别
阅读量:2510 次
发布时间:2019-05-11

本文共 1088 字,大约阅读时间需要 3 分钟。

Here you will get to know about difference between while and do while loop.

在这里,您将了解while和while循环之间的区别。

Both while and do while loops are used to execute set of statements multiple times. But there are some differences between them in terms of syntax and working that I have discussed below.

while和do while循环都用于多次执行语句集。 但是它们之间在语法和工作方式方面存在一些差异,我下面将进行讨论。

while和do while循环之间的区别 (Difference between while and do while Loop)

while循环语法 (while loop syntax)

while(condition){	loop body;}

做while循环语法 (do while loop syntax)

do{	loop body;}while(condition);
while loop do while loop
It is entry controlled loop. That means condition is checked at the start of loop body. It is exit controlled loop. That means condition is checked at the end of loop body.
Loop body is not executed if condition is false. Loop body is executed once even if condition is false.
Generally not used for making menu driven programs. Generally used for making menu driven programs.
while循环 做while循环
它是入口控制的循环。 这意味着在循环体开始时检查条件。 这是退出控制循环。 这意味着在循环体的末端检查条件。
如果条件为假,则不执行循环体。 即使条件为假,循环体也会执行一次。
通常不用于制作菜单驱动程序。 通常用于制作菜单驱动程序。

翻译自:

转载地址:http://ioggb.baihongyu.com/

你可能感兴趣的文章
1048. Find Coins
查看>>
检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005...
查看>>
SpringMVC中文乱码问题
查看>>
输入法遮挡输入框
查看>>
SQL学习笔记第2次
查看>>
【LeetCode】145. Binary Tree Postorder Traversal-二叉树后序遍历
查看>>
收集的各大官网的样式初始化
查看>>
java开发规范总结_命名规范
查看>>
hdu 4366 Successor (线段树 2012 Multi-University Training Contest 7 )
查看>>
ListView异步加载网络图片完美版之双缓存技术
查看>>
Fragment学习系列
查看>>
Shader Compilation for Multiple Platforms
查看>>
frame标签使用
查看>>
Spark Streaming no receivers彻底思考
查看>>
Java IO 操作
查看>>
css3选择符
查看>>
sw算法求最小割学习
查看>>
【HDOJ】1004 Let the Balloon Rise
查看>>
static和 friend友元 的一点调试体验
查看>>
“面向对象三大思想”产生的前世今生
查看>>