Hi guys.
Welcome back.
Indistinct audio will be Bill loanable.
Do I look OK.
The syntax of the do a loop is a do and then statement and saying the body of the look and then the
well condition.
OK so in the previous lesson what we learned is in case of vile Look firstly to level with test expression
and then the body of the statement will be executed.
OK.
And do what.
First this body of the statement will be executed will be ones and then they'll be that is expression
of violation will be taking place.
Okay.
So if the this expression is true then the body of the statements are executed again and then that expression
is evaluated.
Again this process goes on until the test this expression become false.
Okay if the expression is false the look and.
Okay.
So again I'm repeating in gives a vague look first that is expression there'll be this condition will
be there if that is meant that the body of the local big secret there is isn't do while first really
once this body of the statement will be executed then the validation will be done.
Okay.
So if this is true then this will be executed.
And this will be done multiple times under this this expression become false.
Okay.
So we will see for that with the help of a program.
So this is one of the basic sample program for do y.
OK.
So here what I'm doing is I have one more I have a variable here with I I know I have declared as integer
type with an inch less value called Zero.
OK here as I told earlier this is the basic syntax for the way in which the first you do well.
First this this block of code will be executed and then this this expression will be taking place.
OK so here what will happen first it will go in print when we execute this program first it will go
in print this Dennis Ritchie OK I use zero.
So this blueprint.
OK so then what happens is I plus plus.
OK so earlier I is now.
Initially I is zero then I press must miss it to become one of a
okay.
So one is less than or equal to three.
Okay.
So I this condition is true because one is less than three.
So again you will come here again this will printer.
Okay so no no what happens is again.
1 will be incremented by 1 which means you know it too.
I personally think it triggered when we wanted to do so too is as an equal to three.
Okay so condition do it again you become this will big secret.
No two will become three.
I bless this.
Okay so threes as then are equal to three.
So condition a story again.
You come here a European.
No.
And now what happens is after printing here.
This one.
No no.
I will become four.
Okay so four easily then I recall two three.
So conditions one soldier come out of this no.
Okay so now we will execute this program and see see so this one it printed first before any condition
without any condition it printed only once again it printed three times until I value became four.
Okay so when we give for it came out of this.
So that's why it printed one two three.
One two three.
When it became four it came out of this look.
Okay.
So as I am repeating again this statement will be printed first without any test condition.
So it just this one is printed first once.
Then what happens is like it incremented by 1 so which means 0 became 1 then it became then this condition
is true but then again this was executed it was executed and then it became false which means when I
became 4.
So it is less than or equal to through it 3 which is false.
Then it came out of the.
So that's why I printed four times.
OK this how do label do.
Why look books so I'll catch you guys in other video session.
OK thanks for watching.
And bye for now.