difference between while and while loop with example
difference between while and while loop with example
Read about difference between while and while loop with example, The latest news, videos, and discussion topics about difference between while and while loop with example from alibabacloud.com
Day 4: loop structure (while, do... While, ),... While1. Loop Structure (while, do... While,)
1.1. What is a loop structure
In daily life, there will be a lot of things that need to be done repeatedly, such as four seasons of every year, 7 days of
1. Loop Structure (while, do... While,)
1.1. What is a loop structure
In daily life, there will be a lot of things that need to be done repeatedly, such as four seasons of every year, 7 days of every week, 3 meals a day, and 50 copies of each
First, Introduction
In shell programming, circular commands are used to control the execution of certain statements under certain conditions, with three commonly used loop statements: for, while, and until. While loops and for loops belong to the
4.3 Loop control statementsIn the real world, there is such a phenomenon:As long as the current oil in the tank is less than the tank capacity of 100 liters, the fuel tank has been refueling;has been continuously for the motherland hard work, as
4.3 Loop control statementsIn the real world, there is such a phenomenon:As long as the current oil in the tank is less than the tank capacity of 100 liters, the fuel tank has been refueling;has been continuously for the motherland hard work, as
You can use the for statement to control multiple variables to implement advanced applications with multiple loops.The following shows a program that uses the for statement to output a 9*9 multiplication table: The code is as follows:Copy code
The only difference between the first two is that the order of loop and judgment is different. do-while is more than while, and I will not give an example.For loop I believe everyone is familiar with it, so let's look at the for-in sentence.This is
Usage of the PHP tutorial loop statement for while doing whileLoop structureOne, while loopwhile (expression){loop body;//Repeat until the expression is false}
$num = 1;
while ($num Print "number is $num ";$num + +;}
print ' Done. '?>
Loop structureone, while Loopwhile (expression){The loop body;//executes repeatedly until the expression is false}Code:$index = 1;while ($index {Print "number is {$index}";$index + +;}print "Done";Operation Result:Number is 1Number is 2Number is
The first two only difference is that the loop and the order of the judgments are different, do-while than while more than one cycle, I do not give an example.For loop I believe that we can not be ripe, we will see for-in this sentence.This is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.