 Hello friends, I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I am going to explain use of break and continue keywords in Loom. So I will be implementing these uses in C programming. So before starting, if you go to detail and description of this video, you will find links of various playlists. So you can watch them to learn programming. Now coming on to the topic. So first time I am going to explain the use of break and then we will see the continue keyword. So if we talk about break so break is used to terminate execution of Loom. So if you are using break inside Loom, then it can terminate execution cycle of the Loom. So now let's see how it works. So right now I am implementing of all Loom but you can use this break keyword with any Loom. Maybe it is for, maybe it is wide or maybe it is too wide. So let's say here I am writing backslash and possibly and I am going to print value of I then if I W equals to 3 then I am writing break and after this if block I am writing inside Loom. So here you can see this if is having only break because currently this is not there. So if we don't use currently this is it means if will have only one statement with it and this print is not associated with it. Now I am going to repeat this loop it will start from one check its condition so it is 2. Then value of I will be printed that is 1. Now check this condition so it is false so this break will not work right now. So control will be transferred here so inside loop will be printed then I plus plus takes place so I will become 2 so 2 will be printed again condition is false so inside loop will be printed then I plus plus I will become 3. Now first I will be printed as 3 then this condition will become true so I is 3 so 3 W equals to 3 is true so break will work so as I told you break it is used to terminate execution of loop so wherever control goes to break from here onwards loop will not execute anything and control will be transferred outside so this will be the output if we are using what we are writing this for so I hope you understood the use of break so if you want to break execution of loop at a particular point of time then you can implement this here and is it expected to do it can be for loop it can be while loop or it can be do by loop so you can implement break with any kind of loop so I hope you understood this implementation and the use of break now coming on to continue so if we talk about continue so continue is having different nature as compared to break so this is continue keyword so it is it skips rotation of loop so if don't terminate it don't terminate it just skips rotation cycle of loop how it works so here I am writing this and let's say if it is written with continue so again it is not having any curly basis so this will repeat of it so with this logic rotation only one rotation will be script so first I am going to tell you how you can skip one rotation then I will tell you how you can skip more than one rotation so starting from here one then condition is true one will be printed check this condition it is false so control will be here we can print inside loop then I will become 2 so 2 will be printed condition is false so again inside loop will be printed then it will be 3 so 3 will be printed now this time if condition is true so we are on continue so from here control will be transferred to increment part 1 because right now this condition is true so I will become 4 and this will not be printed this inside loop one time is finished so whatever is written after continue if continue is executing so whatever is written after continue won't execute I will become 4 so 4 will be printed now check this condition it is false so this time it will be printed and then I will become 5 so 5 and inside loop will be printed again because 5 is not equal to 3 so continue will not execute so in this scenario continue executed once so only one rotation was scripted so this I hope you understood now I will tell you how scripted more than one rotation so let's say I am using this if I modulus 2 W equals to 0 then only we need to use this keyword continue we need to execute this keyword continue so it means if I is even then continue otherwise won't so again starting from the beginning I is 1 condition is true so 1 will be printed so 1 modulus 2 is not equal to 0 so it is false so inside loop will be printed so it will print already then I will become 2 2 will be printed now 2 modulus 2 the vendor is 0 so continue will execute so this will be scripted so when I is having even value then inside loop will not be printed then I will become 3 it will be printed 3 modulus 2 so 3 modulus 2 the vendor is not 0 so this time continue will not work and this will print so when we have value as 3 so inside loop will print then I will become 4 so 4 will be printed 4 modulus 2 so this time again it is equal to 0 so continue will work and control will transfer here it will not execute so in case of 4 inside loop will not print I will become 5 so 5 will be printed and 5 modulus 2 the vendor is not 0 so continue will not work and inside loop will print so you can see only in case of odd numbers both desert and inside loop are printed in case of 2 and 4 only digits are printed this message is not printed so this way you saw how we skipped multiple rotations or more than one rotation of loop with help of continue so whenever control reaches to continue whatever is written after continue statement won't work it skips that particular rotation so this is the use of continue so use it properly because with the help of break and continue you are doing some extra functioning while implementing the loops so if you use break and continue then your loop is having additional features so use them carefully so that your output will be correct so I hope you understood how we can use break and continue with the help of loops and see programming so if you want to watch more programming related videos you can open my channel go to playlist and there you will find more than 1000 videos related to programming so do watch them and I hope you understood whatever I explained in this video thank you for watching this video