Hey, guys, what's up?
So until now, we have only seen one kind of law that was Vilo.
Now in this we do we will learn another type of flu called for love.
OK, so what happened?
ENVI Lupus.
So this is your initialization.
Then vilely and then this is my condition, then these are the instructions that I have to execute.
And finally, this is my update.
So this is a general vibe loop.
Similarly, the full look will be forward initialization.
Semicolon column condition.
Sam McWilliam, update.
OK.
This is only the difference between for loop and by loop.
OK.
So here all the three things were at different places here.
All the two things are the same places.
Otherwise, the Viking of full loop and via loops.
Exactly same.
OK.
So they're working off for loop and via loop is exactly same.
Just this is only the difference.
For example, if you so for example, if I want to print hello five times and via loop I will write
something like.
And I equals one.
While ILADS then goes to five, I will see out.
Hello.
And I Pless place.
Similarly for printing Dialo five times and for Loop I will write for initialization.
And I equals one.
Now the condition I left then goes to five.
And now the update I plus.
Plus and see out.
Hello.
Okay.
So this is only the difference here.
All that three things are at different places in four.
Look.
All the two things are at the same place.
So how does four look.
Will work.
So initially I equals one.
So initially I was when I will check the condition.
Condition is to go inside the loop print.
Hello.
Then after this, when I will reach here, I will again come up and gives the value.
So the value of I will become to check the condition.
Condition is to go inside being telo again.
Go up.
Increase the value.
So value will come three.
Again, check the condition.
Brent, hello again.
Is the value of I will become four.
Check the condition.
Go inside.
Do the work increment devalue.
So I will become five and.
And I will become five.
Check the condition.
Go inside.
Brent.
Hello again.
Come up.
Increase the value.
Now I was six.
The condition is false.
So the condition is false.
I will reach here.
Okay.
I will reach here.
The condition is false.
So what is the difference between while loop and for loop.
So that difference is only this.
All two things are at different places.
And then for Loop, all the three things are at the same location.
OK.
Now, let's see an example.
So, for example.
So, okay, so let's name it for Loop, so for Loop, not CBB.
OK, so now what we do is we will try and print hello five times and work with the help of for loop.
So for initialization now the condition.
And now we have to update.
So I.
Plus plus.
Well we have to do we have to see out.
Hello.
OK, so I plus versus same as I equals a plus one.
So later in our program.
So is getting printed five times just we have to give the spaces.
So now let's do it again.
OK, so Halo is getting printed five times.
So they're working off for Loop and they're working off via Loop is exactly same.
This is only the difference here.
All the three things I had the same location and in my loop, all the two things added, different location.
Otherwise, there is no defense in the working principle.
So what we will do now is I will solve your problems with the help of for loop.
So you get a better understanding or for loop.
OK.
So that is all for this video.
Thank you.