Hello and welcome to goal and programming language course.
In the previous session, we talked about for Loop at Infinite Loop and Indecision.
We want to talk about the other loops and control statements.
For Luke as vile Luke A for Luke can ask the world as a vine Luke, this loop is executed until the
given condition is true.
When the value of the given condition is false, the loop ends.
Now you can see the scene techs.
Let's go to this school program to illustrate how to use Follow-Up as a white loop.
First, define a variable as loop initialization, for example, define a variable like PI column equals
and initialize it by one.
Now define loop at sit and condition.
Four.
Terminate it, for example, for set condition I less than five open and close curly braces and write
the statements here.
For example, in this case, we want to print I variable value.
So we write FP I and go to the next line.
Now we must always increment the iterator here.
It's already a bit, so we write I + + OK, reformat the code, save the project and execute the program.
Now go to terminal run the program by the comment Go round dot back.
This mean that go now we can see the output one two three four.
In this example, we defined the variable named I and initialize it with the value of one.
And then as long as I is less than five, one unit is added to the variable I each time and we were
able to use the for loop as a vine loop.
Also, the code block can be as many lines as you want.
In this example, it's just one line of code that gets repeated.
OK.
In order not to prolong the time of decision, we will finish it and we will continue the content in
the next session.
Goodbye.