Hello and finance Hello What is this look statement okay and why is it know nothing about something going again and again okay I want it let me go here see, let me clear we understood this part Let me clear this see. So now let's see I have some piece of code we have written some piece of my code number one my code number line number two like this I have written some piece of code here, okay. Now, as I said my ignition is going to start line by line. So, like this painter to start, if there is no control flow statement, it will start, but do some thing I want. Okay, let's integrate execute these five statement atlases. 10 times okay my ignition will come like this okay my instead of going straight like this My ignition will come to this Okay, then I will execute this statement for 10 times in a loaf, okay.
Then time you do the statement again and again then go out. So if you want that kind of thing, we can use my looping statements. Okay, I will say, Lexi, whenever you are, you are in home, okay. So you do all the activities one by one to prepare food and you eat the food and you may study something Oh, you mean go to bed and sometimes decorating the room, you need to ship some books from one cell to another cell. That's a motto. You cannot take all the books in a single cell.
So maybe you have 15 number of books in one cell. So you will take pi books, keep it negative calm, take pi books, keep it like this. You're looking in your life for goal building and take same activity we're doing again and again and again. Same thing, insert these I may have five four lines of code is doing the same thing. And I can no big 10 times a couple times depending on my business environment for anybody who wants that kind of thing, we can go for the room. So normally this isn't law these four lines of code select the code only once you can go on the normal position.
But now these four line up or I can do it multiple times by my loop statements. And when I say loop statements, I have a do while I have a wife and also I have potluck segments so I'm we're going to discuss this three along so I can say one more equal policy, this points, different looping statements. Okay? Do while while for any cause until now. qualifying Yeah, yes. Perfect, perfect.
Okay, now let's see password understand what is do while and what is why we'll differentiate that to then go further. Okay, then we'll see what is foreign for it and unfortunately according to us, okay, so now let's see I will give you one basic scenario okay. There will define what is boilers but it will say both do the same activities, but in different context let's I'll give you one small scenario. We bought like he was waiting for this. Okay, so we get one one car to you. Okay, okay, maybe you can take the wallet or anything.
Okay. Now I used it before buying anything. Check if Have you have money in karate? Okay. Okay, let me write what should be happening on to see I'm doing okay. So Kyle benteke stealing her money and by the money over I said this line.
Okay, and one more scenario I'll say bye Are you do the shopping If you have money in your wallet okay this two thing I do, let's consider in my in my wallet Okay, I have only right now something like hyper diversity for example. Okay, only 500 USD. Now what happened? You went for something and that may cost around 900 Okay, so something are buying which cost 900 then EPC overpass arpit you buy it, then take your money again buy it. Okay, so in what's going to happen and one more thing that I said you before you buy you see either money or not. So now if I see some product is 900 something are going to buy within 150 and you have 500 USD Daniel by Norbert.
The you don't have money on your wallet which will cost 900 What do you have available but on so 500 but you cannot buy it okay. So that means you pastic how much available you have to check the condition if condition satisfied, then do it. So, so I can just more generically Canada Can I write eight hours? If conditions satisfied, then do it, this will swap even more money in record. So, if I just read the statement, if conditions are satisfied, then do it. Okay.
Kenny, Kenny, say this one pass do it. Then click the condition no password whatever past do read then check my condition. Okay, if still listen to this again, do it this bad. Okay, so now whenever I'm saying you have a valuable balance of hyper diversity, what do you want to buy something 900 and on this part You check the condition your balance is less than 900 that means you cannot buy anything hurt. But if you go on this area in a while loop you cannot buy any any anything. Am I correct?
Minus minus? Yes. Okay, so what I'm trying to say in a while Oh, we will pass check the condition, then we'll execute the statement if condition satisfied. Okay. And in do while what you do will pass integrate, then we will check condition satisfied then we'll continue again. So now on discuss what happens I have only 500 USD.
But if you see something I'm trying to buy which is 900 USD, so pass I'll buy it, then I will check. Okay, quite appropriate. I'm going to select Next. So for that, do I have balance or not? If you don't have, then we can revert past I can bite the legs. Take one more basic example.
Okay. Let's see you have found of around 3000 USD honor wallet okay now what is going to happen with this the certain University whatever you follow up so now I'm going to isolate first Niner Niner the fastest Iroquois this far okay? I have one product that I want to buy with 900 then I have 1000 and then we have with the 300 then again I have with 1000 and we have one with 1000 then sampled also yeah with so now I'm going to buy so see I have 3000 USD, okay. I checked balance 3000 which is greater than password I select is greater than 900 then what I did, so I simply went and I bought this one. Okay, then now for how much happened? So 3000 minus Niner.
Can I say no? I have only 2100 Okay, so then again I take away 2100 I have balance the order 100. Okay, I can by simply I go and pick it up. So then how much are you? Now I have 1100. So after this, I have 1100 so fast, I'm checking the condition, then I'm buying whatever I want.
Then I see like, okay, I haven't even under. So when I say I will live in under the under default of 300. Yes, I can buy. I'll go and simply, I'll buy this also. Okay, so now how much I have, then I have a 200. Okay, so now they're gonna say there is another 1% but I have 800 then I can pass I'm taking the condition.
Then I'm buying all the things, you know. But when I'm buying the same, same thing, I'm doing some state mitigation or I'm doing something. So when I say do while Eve I have heard of nine I have something with the 1000 okay then something we do 300 Okay, then I have something called 1000 okay and 500 okay many things, see, if I want to go past I will take it then as the governance those things. So, in the both things if you see this example of hybrid industry. So in the while loop, my statement may not integrate at all, whenever I have 500 and I have heard of I have something with Niner USD, I couldn't buy it. That means my statement is not going to do it at all.
But 2.0 while I'm exhibiting at least once, then I may not have not agreed. So, in Doyle saying, past time you execute your statement, then you check the condition. If condition matches, then we can loop it to execute again, while saying you pass check the condition, then take what happened to integral and still if it's satisfying you This so you can do it. For example, okay, let me show you one technical example here, we could do one, I have defined something called integer count. Let's see identity. And so now I say, do so now you can see, let's I'm just going to print this document.
I'm just going to make counts here. Okay, then I'm increasing my count one, count one, one. So it's not important as account loss loss, which will be equivalent to count equal to count plus one is nothing but mine was implemented operator to count equal to count plus one up on the right, simply you can write down so I'm increasing 10 to 1111 to 12 is time then then I'm going to check Hawaiian Okay, what condition I have, if till the time count less than 10 do it. If this is the master admin, so even do this, my count is 10 Okay, and my condition is Congress content okay let me write the syntax of do while first before going to here it will be like many people will be confused with the do while statement. So not to be confused okay. So I'm just writing the syntax here then you see a lot is not clear will not skip to entropy then if I do my statement a juice and press OK then check the condition till the time my condition satisfying will execute my look this is my do holster and when I say coil in the coil heart I have my coil segment which will be loops like this Okay.
So now while see I got while fast okay then insert is I will write my condition check okay then insert this registered. So that means this statement executed only when this condition in condition matches. So how we are going to do it? So now you can see if this is a do while statement. So now my count is 10 Okay, and I'm going to print the statements and I'm in taking the account value, insulin. Okay, so now let's see I actually got it, what's the output coming?
Let's see, I executed. So when I execute, if you go here let's debug it is showing 10 value on scurred say so again. So now EPC mechanism count less than 1010 is not less than 10 mechanism. Borstein. I have devoted my low once. Okay.
So past we do, then we'll check the statement to continue. Okay. If the same statement, if we will write on while statements. We'll see what happening. So I'm just covering this one. So let's see, I'm writing while.
Okay? Count less than 10. I'm just going to print the count. Okay? And I'm just initializing the round, equal 10. And also, I'm insert this increasing my count.
See, if I wrote these things, same kind of thing I'm doing, I do the condition check powers. In my condition satisfied and I wondering to see, I click on this part, nothing is going to come because my condition is fell already. My count is not less than 10. See, nothing, nothing is gone. So I didn't include anything. No statement code in the past.
I checked the statement then I do it. But in this case what happened first I executed, then I check my condition to see if I if you see how this eloping happens. Let's see, I kept my initial count is one I want to increase in my count is good. So when they come past what I'll do here, first I'll print one icon here my English status one year, my count value is one now, then do it what I will do, I will print my statement here first word secondary print, I will print one way to make count is one, then I'll come I'll increase that it means I had one value adding one which is going to be two then I'll check Okay, in the coin segment check to less than 10 Yes, mine will rest until again do the same thing. I'll come here I will bring what is over I will also count no boundaries to so the account Okay, then I can increase my to count two plus one, which is going to be three, then I check again, okay, three less than 10 is less than 10.
Again go again I print three here, I'll come here I increase one, which is going to be four like this may have been continuing, if I record this dogpile Now you will see this standard statement or these two statements what I have the intellect dude multiple times and each time we'll get one debug statements to see either executed. Let me execute. Let's see the lines see 123456789 everything we got it What can I say? Till the time my condition satisfied? I got it. Am I correct?
Only the difference between do wild and wild is that doing while past we check the condition then we start the education into well past We'll start the introduction then we'll start the condition check. Okay, so in the case of for counter to 10 in do while I got only one time and interesting happens, then my condition not met then I didn't go insert the loop, but in a while look past it is a condition condition not satisfied, I didn't come to inside. Okay, so this way we write my looking statements in the domain. So to highlight about we can execute the same thing again and again. Okay. Either same program I will try to write in the oil statement.
See, if I do it one thing do it one I'm just trying to execute only this must be supposed selected here. And I have a button called execute highlighted that means which I have highlighted, I like to do only that piece of code. I just integrate now in the whole segment. You see same kind of logo with Okay, that means I included that statement, which we have instead of Weissberg or insert that multiple times nine times eight okay. So, do let me know if any more questions on this or any questions on this day if you want the wisdom and so, like the difference between due Monday and while what I understand is like if you want to execute one condition at least one without checking the condition then we should use this do i right. Perfect.
Okay. Yeah, yes and I have another query is like, if we will make this integer value to final and then it will not work right. Let's see, how do you see now, we are we discussed what is my final part. Let's see if they try to use final here what is going to happen? So, they just happened count plus plus this is a final variable he will try to use what is happening here see basic elements cannot be modified again we already inserted it done yes perfect and it goes in lowercase yeah no emphasis No thank you. So, I hope everybody clear on this see while and do while on one line difference is that in do while past execute, then check the condition in a while past check the condition if satisfied then a good deal of time while my condition satisfying will continue the intuition that the point is the same and satisfying.
Yes. Same way, okay. So same way we are going to see in the let me copy this for you. Okay, I just put on I'll share with you all these few notes also Okay, very basic examples, okay, but to the specific levels we'll need in life always Okay. So now same way we have something called formal okay. And again I said I have two type of form of Okay.
What kind of follow via okay. So this is one follow up so whenever it is a follow okay what do you do the