1 00:00:01,190 --> 00:00:06,500 So our next Condor's statement is why loop statement? 2 00:00:07,750 --> 00:00:18,220 So while it's also similar to our follow up, but it will always execute anthology when cognition is 3 00:00:18,230 --> 00:00:21,760 full, I'm blessed that that condition is false. 4 00:00:21,970 --> 00:00:25,210 It will not stop executing right. 5 00:00:25,600 --> 00:00:28,030 So this index is very simple. 6 00:00:28,220 --> 00:00:30,070 Why condition true? 7 00:00:30,280 --> 00:00:32,890 We should give it conditional on a year basis. 8 00:00:32,890 --> 00:00:37,120 Often then it is the execution block race US boss. 9 00:00:37,720 --> 00:00:40,390 So you can see the flow chart to understand it. 10 00:00:40,780 --> 00:00:46,390 So while there is a condition condition, espoo condition is true. 11 00:00:46,420 --> 00:00:48,090 Then a core block is executed. 12 00:00:48,610 --> 00:00:49,540 Then it goes. 13 00:00:49,540 --> 00:00:53,200 After the executing of the core block, it will again check condition. 14 00:00:53,410 --> 00:00:55,870 If it is true again, it will again execute this. 15 00:00:56,110 --> 00:01:01,810 If the condition is barzagli, then it leaves the bloc and continues with the execution of that program. 16 00:01:02,140 --> 00:01:04,260 So why do you have to be careful? 17 00:01:04,270 --> 00:01:07,160 Is why creating wild conditions? 18 00:01:07,390 --> 00:01:14,650 You have to make sure that at some point of time, conditions should be hours and it will be leaving 19 00:01:14,650 --> 00:01:22,350 the program because if it is not Foy's, this will be an infinite loop because condition is now becoming 20 00:01:22,350 --> 00:01:22,780 a force. 21 00:01:22,780 --> 00:01:29,020 That means this block will be continued to execute many times, writing infinite times because this 22 00:01:29,020 --> 00:01:33,720 is ticking through, executing again, ticking through executing. 23 00:01:33,760 --> 00:01:40,250 So it will continue that infinite times and the program may not be stopping program will be infinite. 24 00:01:40,870 --> 00:01:47,380 So that said, back thing, right, that our programming will not be executed, that will be in bad 25 00:01:47,380 --> 00:01:47,920 situation. 26 00:01:48,100 --> 00:01:49,840 So make sure that you will. 27 00:01:52,310 --> 00:01:58,940 Give a condition we usually give the condition in such area that the condition should be forced at some 28 00:01:58,940 --> 00:02:05,510 point of time only after the number of times we want that program to be executed without that cord blood 29 00:02:05,510 --> 00:02:09,380 to be executed that many times or lead should actually execute. 30 00:02:09,560 --> 00:02:13,100 So that's one thing we need to make sure we are losing, right? 31 00:02:13,160 --> 00:02:14,120 No statements. 32 00:02:14,270 --> 00:02:18,550 So next, we will be going to a wireless program. 33 00:02:18,860 --> 00:02:21,620 So have a book by Alexander programme for you. 34 00:02:23,000 --> 00:02:31,790 Here you can see I have given IEEE equal to zero as the value, and when the value of AI is less than 35 00:02:31,790 --> 00:02:33,350 five, then you have to print. 36 00:02:33,890 --> 00:02:37,820 If the value of AI is reaching five or more than five. 37 00:02:37,940 --> 00:02:44,500 You have to see from this look, this is a simple program, just printing numbers from zero to five. 38 00:02:45,050 --> 00:02:45,410 OK. 39 00:02:45,710 --> 00:02:51,560 So I hear you can see is greater than five are equal to zero. 40 00:02:51,560 --> 00:02:52,400 AI is less than five. 41 00:02:52,400 --> 00:02:53,060 It's true. 42 00:02:53,490 --> 00:02:53,870 No. 43 00:02:54,200 --> 00:02:55,520 Then I will be printing AI. 44 00:02:55,520 --> 00:02:56,170 That just zero. 45 00:02:56,750 --> 00:02:58,790 Then I will be incrementing AI is No. 46 00:02:59,030 --> 00:02:59,420 One. 47 00:02:59,900 --> 00:03:01,850 So it's again going to the condition. 48 00:03:01,860 --> 00:03:02,360 Check back. 49 00:03:02,720 --> 00:03:04,550 I use one one less than five true. 50 00:03:04,820 --> 00:03:09,410 Then it will be printing one going again due to less than five. 51 00:03:10,460 --> 00:03:10,880 True. 52 00:03:11,600 --> 00:03:11,750 Again. 53 00:03:12,050 --> 00:03:12,530 Three. 54 00:03:13,070 --> 00:03:13,550 Print. 55 00:03:14,060 --> 00:03:14,480 True. 56 00:03:14,720 --> 00:03:15,020 Right. 57 00:03:15,920 --> 00:03:22,340 Likewise, it will mean one zero one, two, three and four Wyden-Bennett will, and it will reach right. 58 00:03:23,120 --> 00:03:26,330 Then it will go check five less than five spots. 59 00:03:26,570 --> 00:03:28,300 So it will exit that. 60 00:03:28,430 --> 00:03:32,480 This very block, it will come to that next step, which is the end of the program. 61 00:03:32,660 --> 00:03:34,160 So it will exit that program. 62 00:03:35,330 --> 00:03:38,570 Now see, we can see this program in action. 63 00:03:39,200 --> 00:03:42,580 Let me clear the cancer cleared it. 64 00:03:43,070 --> 00:03:44,120 Now let me 65 00:03:46,670 --> 00:03:47,830 compile this program. 66 00:03:48,260 --> 00:03:53,030 G Plus Plus Wild Dog CBB. 67 00:03:54,820 --> 00:04:01,300 Successfully, no, because that I don't know why at us now we can dodge, slash and get up. 68 00:04:02,350 --> 00:04:04,840 I'm sorry and thought out I used to. 69 00:04:06,600 --> 00:04:07,080 Yes. 70 00:04:07,320 --> 00:04:08,910 Zero one, two three. 71 00:04:09,150 --> 00:04:10,800 This is the album, which I have explained. 72 00:04:11,400 --> 00:04:12,240 So that's it. 73 00:04:12,480 --> 00:04:13,900 It's very simple to use my. 74 00:04:14,670 --> 00:04:20,700 But make sure that there should be an exit condition if the exact condition is not getting properly 75 00:04:20,700 --> 00:04:24,120 identified or given, this can be an infinite loop. 76 00:04:24,570 --> 00:04:28,400 We have doorway lock statements, so do well. 77 00:04:28,410 --> 00:04:36,120 New statements are also used to execute vibrations or execute a block many number of times, according 78 00:04:36,120 --> 00:04:36,960 to your usage. 79 00:04:37,290 --> 00:04:42,860 But there is a difference between small difference between Duval and why you do. 80 00:04:42,910 --> 00:04:51,210 My loop is executed at least once because it's an exit control room, which means so we have to. 81 00:04:51,420 --> 00:04:55,200 Then we've open the bracket, then we have a lot of things to execute. 82 00:04:55,200 --> 00:04:57,030 That statements will be written on this lot. 83 00:04:57,270 --> 00:05:01,590 Then we close the loop, then we have way and condition. 84 00:05:02,820 --> 00:05:04,560 So fast execute the block. 85 00:05:04,920 --> 00:05:06,960 Then it goes and check the condition. 86 00:05:07,170 --> 00:05:10,080 So at least once this block will be executed. 87 00:05:10,560 --> 00:05:12,420 So do car block. 88 00:05:12,660 --> 00:05:15,720 If condition is true, then it will go to the tower block again. 89 00:05:16,350 --> 00:05:22,560 Then it will check the condition again with conditions to again execute God when the weather conditions 90 00:05:22,560 --> 00:05:25,650 for it just get outside the loop. 91 00:05:26,640 --> 00:05:29,430 So one more thing, one more note, one more thing. 92 00:05:29,430 --> 00:05:35,460 I have already explained this thing that is it will execute on at least once because it will check the 93 00:05:35,460 --> 00:05:37,320 condition after the initial execution. 94 00:05:37,500 --> 00:05:43,890 It will condition check the condition at the last point after executing that code block. 95 00:05:44,040 --> 00:05:45,300 Let's see this one in action. 96 00:05:47,460 --> 00:05:50,040 So I have a two mile program over here. 97 00:05:50,280 --> 00:05:54,540 Here you can see my head up high and I have included that. 98 00:05:55,620 --> 00:06:01,950 Then I have eight or 10, then I am protecting the value of being equal to. 99 00:06:02,970 --> 00:06:05,060 Then I'm printing in that. 100 00:06:06,450 --> 00:06:12,060 Then I am incriminating them, I look forward to one that is A. To plus one plus one equals 11. 101 00:06:12,450 --> 00:06:13,560 Then I am taking the. 102 00:06:14,620 --> 00:06:18,600 Condition 10 less than is true, right? 103 00:06:18,850 --> 00:06:25,750 So what does output of this program, at least the smell this look will continue to execute until he's 104 00:06:25,750 --> 00:06:26,980 less than 20. 105 00:06:27,250 --> 00:06:30,340 So then what number this will show up? 106 00:06:31,010 --> 00:06:33,180 Brent, can you guess it? 107 00:06:34,260 --> 00:06:35,160 Yes, you are right. 108 00:06:35,340 --> 00:06:43,680 It will be printing until 10 to 19 because on reaching 20, this condition become false. 109 00:06:44,070 --> 00:06:50,340 So we're going to see this program in action, clearing that I'm sorry again, I'm doing the. 110 00:06:51,610 --> 00:06:58,930 G Plus Plus for compiling this program, though, while not CBB, No. 111 00:06:59,010 --> 00:07:01,870 One, I'm going to run this program. 112 00:07:02,440 --> 00:07:05,230 Does my running government dodge slash, you know? 113 00:07:08,110 --> 00:07:11,800 See value of from 10 to 19. 114 00:07:12,130 --> 00:07:19,930 There is no guarantee because this condition will be becoming false because 19 after nine, it's will 115 00:07:19,930 --> 00:07:25,300 be 20 20 less than during these wars, so it will not execute this again, this block. 116 00:07:25,540 --> 00:07:27,760 It will just go out of that program. 117 00:07:30,070 --> 00:07:33,000 So hope you have understood this portion as well.