1
00:00:02,390 --> 00:00:03,980
Hey, guys, what's up?

2
00:00:04,520 --> 00:00:12,890
So now we will learn how to alter the flow of a loop so we can do this with the help of big art, with

3
00:00:12,890 --> 00:00:14,090
the help of continue.

4
00:00:14,780 --> 00:00:16,250
So let us Fallston list and.

5
00:00:17,200 --> 00:00:18,810
What is the flow over loop?

6
00:00:19,930 --> 00:00:21,290
So you are having a loop.

7
00:00:23,710 --> 00:00:25,370
You will be having condition here.

8
00:00:26,000 --> 00:00:31,180
Then you will do some work and then this is the ending of loop.

9
00:00:31,910 --> 00:00:33,080
So what happens generally?

10
00:00:33,500 --> 00:00:40,130
First of all, there must be some initialization then if you must be having her condition.

11
00:00:40,400 --> 00:00:46,190
So if this condition is true, you will go inside the loop and you will execute all the instruction

12
00:00:46,580 --> 00:00:47,780
and Venu will reach her.

13
00:00:48,140 --> 00:00:51,620
You will again come upward and you will check the condition.

14
00:00:51,950 --> 00:00:57,960
If the condition is again through, you will again do the work and then you will again check the condition.

15
00:00:58,640 --> 00:01:03,890
If the condition is again through, you will again do the work and then you will again check the condition.

16
00:01:04,430 --> 00:01:04,740
OK.

17
00:01:04,970 --> 00:01:08,540
So if the condition is falls, then you will reach here.

18
00:01:08,990 --> 00:01:13,650
So if the condition is falls, then you will reach her, OK.

19
00:01:14,120 --> 00:01:15,830
So this loop.

20
00:01:16,160 --> 00:01:19,850
So this loop will get terminated.

21
00:01:19,970 --> 00:01:23,540
This loop will get terminated.

22
00:01:24,260 --> 00:01:29,340
Venne condition when condition is false.

23
00:01:29,900 --> 00:01:30,150
OK.

24
00:01:30,440 --> 00:01:37,190
So if this condition will become false, you will reach here at this line after after this you will

25
00:01:37,190 --> 00:01:37,660
reach her.

26
00:01:37,760 --> 00:01:39,000
If the condition is false.

27
00:01:40,520 --> 00:01:40,760
OK.

28
00:01:41,960 --> 00:01:43,670
So what do we do in this?

29
00:01:43,670 --> 00:01:44,130
We do.

30
00:01:44,240 --> 00:01:45,350
Let us talk about.

31
00:01:45,500 --> 00:01:45,950
Break.

32
00:01:46,370 --> 00:01:47,150
And next we do.

33
00:01:47,210 --> 00:01:48,030
We will talk about.

34
00:01:48,050 --> 00:01:48,680
Continue.

35
00:01:50,270 --> 00:01:50,510
OK.

36
00:01:51,790 --> 00:01:52,960
So what Blake will do?

37
00:01:53,830 --> 00:01:55,150
So you are having a loop.

38
00:01:56,340 --> 00:01:58,450
OK, here's a condition.

39
00:02:00,110 --> 00:02:06,530
There are so many structures, then you are having brakes, treatment, then some instructions.

40
00:02:09,460 --> 00:02:10,420
So what will happen?

41
00:02:11,380 --> 00:02:14,960
First of all, to check the condition condition is true, OK?

42
00:02:15,400 --> 00:02:16,510
The condition is true.

43
00:02:16,690 --> 00:02:22,990
You will go inside and you will execute all the instruction to execute all the instruction and you reach

44
00:02:23,140 --> 00:02:24,760
at this instruction.

45
00:02:25,540 --> 00:02:26,740
So this is break.

46
00:02:27,310 --> 00:02:30,920
And as the name suggests, it will break the loop.

47
00:02:31,450 --> 00:02:37,130
So as soon as you will execute this instruction, I will reach here.

48
00:02:39,420 --> 00:02:39,700
OK.

49
00:02:40,380 --> 00:02:47,760
So I will reach here as soon as this instruction is executed, loop will be broken.

50
00:02:49,530 --> 00:02:50,770
OK, so we have.

51
00:02:51,160 --> 00:02:56,030
So we have altered the flow of love.

52
00:02:56,620 --> 00:03:04,420
And also, if this brake statement is executed, these instructions will not be executed because I will

53
00:03:04,420 --> 00:03:07,130
reach here directly from here to here.

54
00:03:07,660 --> 00:03:09,130
I will reach here, OK?

55
00:03:09,490 --> 00:03:12,010
It doesn't matter whether the condition is true or false.

56
00:03:12,430 --> 00:03:16,750
So condition doesn't matter if he will hit the brakes statement.

57
00:03:16,950 --> 00:03:17,920
You will reach here.

58
00:03:18,600 --> 00:03:18,850
OK.

59
00:03:19,330 --> 00:03:21,040
So condition doesn't matter.

60
00:03:23,170 --> 00:03:26,140
So, for example, you have a lube.

61
00:03:27,400 --> 00:03:29,770
And here you are having your condition.

62
00:03:30,880 --> 00:03:32,200
Now inside this loop.

63
00:03:33,640 --> 00:03:35,030
You're having one more look.

64
00:03:36,620 --> 00:03:43,520
And similarly, the condition and then you are having some instructions and then there is based treatment.

65
00:03:43,970 --> 00:03:49,400
And then again some instructions and then these other instruction of outlook.

66
00:03:50,510 --> 00:03:52,050
Again, destruction of outer loop.

67
00:03:52,100 --> 00:03:54,000
And this is the ending of outer loop.

68
00:03:54,830 --> 00:03:55,030
OK.

69
00:03:55,430 --> 00:03:57,710
So what will happen if this condition is true?

70
00:03:59,300 --> 00:04:01,340
I will execute these instructions.

71
00:04:02,500 --> 00:04:07,630
And if and when I will reach here, I will execute this instruction.

72
00:04:07,990 --> 00:04:10,110
So I will Lord reach here, OK?

73
00:04:10,300 --> 00:04:11,320
I will not reach here.

74
00:04:11,650 --> 00:04:12,820
I will reach here.

75
00:04:14,930 --> 00:04:23,050
OK, so the inner most the inner most loop will be broken.

76
00:04:24,880 --> 00:04:31,140
OK, so when this big statement will be executed, you will reach here, you will not reach here.

77
00:04:31,180 --> 00:04:32,050
So this is wrong.

78
00:04:32,560 --> 00:04:33,820
You will reach here.

79
00:04:34,420 --> 00:04:35,800
This loop will be broken.

80
00:04:36,070 --> 00:04:36,370
OK.

81
00:04:37,180 --> 00:04:38,740
This loop will be broken.

82
00:04:38,770 --> 00:04:44,470
And also these statements, these instructions will not be executed.

83
00:04:47,280 --> 00:04:47,520
Okay.

84
00:04:49,280 --> 00:04:52,400
Now, if you are having so, for example.

85
00:04:54,620 --> 00:04:55,280
Condition.

86
00:04:58,240 --> 00:05:01,810
Then again, lobe, then again, condition.

87
00:05:04,030 --> 00:05:05,290
Then some instructions.

88
00:05:08,180 --> 00:05:10,100
Then destruction, then break.

89
00:05:10,820 --> 00:05:12,020
Then some instructions.

90
00:05:13,190 --> 00:05:13,370
OK.

91
00:05:13,490 --> 00:05:16,040
So in this case, if this condition is true.

92
00:05:17,020 --> 00:05:24,100
I have this condition as to this loop will get executed first, if the conditions become false, you

93
00:05:24,100 --> 00:05:29,770
will reach at this line, you will execute the instruction, then you will hit the brakes treatment

94
00:05:30,220 --> 00:05:31,280
as soon as you will reach.

95
00:05:31,390 --> 00:05:31,640
Yes.

96
00:05:31,710 --> 00:05:35,120
And as you will hit the big statement, then you will reach her, OK?

97
00:05:36,010 --> 00:05:37,720
Then you will reach at this lane.

98
00:05:40,100 --> 00:05:40,300
OK.

99
00:05:40,400 --> 00:05:43,700
And these instructions will not to be executed.

100
00:05:44,030 --> 00:05:45,500
So we have altered.

101
00:05:46,630 --> 00:05:49,900
The normal flow ofa loop of loop.

102
00:05:49,970 --> 00:05:53,380
OK, so we have altered the normal flow of the loop.

103
00:05:53,770 --> 00:05:56,720
So this is all my big statement works.

104
00:05:57,580 --> 00:05:59,470
So let's see in voguing example.

105
00:06:00,520 --> 00:06:02,190
So I have already made the file.

106
00:06:02,200 --> 00:06:04,420
The name of this file is Brigg Dot CPB.

107
00:06:04,810 --> 00:06:09,520
Now, what I will do, I will write a program and you have to tell me what will be the output of the

108
00:06:09,880 --> 00:06:10,360
program.

109
00:06:10,700 --> 00:06:12,070
OK, so let's get started.

110
00:06:13,060 --> 00:06:16,690
So let's create a variable lie, which is initially, too.

111
00:06:17,350 --> 00:06:19,440
Now let us right away loop.

112
00:06:20,670 --> 00:06:22,630
I am putting some random condition here.

113
00:06:22,690 --> 00:06:25,100
While I less than goes to, let's say, 20.

114
00:06:26,890 --> 00:06:31,720
Now let's say I'm using F again some random condition.

115
00:06:31,750 --> 00:06:40,750
If I let's say Moorgate, if I made it equals equals zero then what do you do.

116
00:06:40,780 --> 00:06:42,370
I will increment the value of I.

117
00:06:43,860 --> 00:06:44,050
Okay.

118
00:06:45,100 --> 00:06:51,360
So otherwise I will print the value of high and low to give spaces.

119
00:06:52,750 --> 00:06:54,540
And incrementally value if I.

120
00:06:55,210 --> 00:06:55,410
Okay.

121
00:06:55,450 --> 00:06:57,100
So I am not using Bayes statement.

122
00:06:57,430 --> 00:06:58,670
So tell me what the output.

123
00:06:58,840 --> 00:07:01,060
I think my output will be.

124
00:07:02,710 --> 00:07:07,780
So if the value of AI is to okay, the value of I used to this condition is false.

125
00:07:07,840 --> 00:07:10,820
I will reach FCL, they will be printed.

126
00:07:11,110 --> 00:07:13,350
I plus press the new value of I use three.

127
00:07:13,720 --> 00:07:15,090
So this condition, again, false.

128
00:07:15,650 --> 00:07:18,580
They will be printed four, five, six, seven.

129
00:07:18,970 --> 00:07:20,430
Now the value of I will become eight.

130
00:07:20,710 --> 00:07:22,060
So it is less than 20.

131
00:07:22,750 --> 00:07:26,200
I will check here it Mordred is zero.

132
00:07:26,290 --> 00:07:28,540
So I Pless press the new value of I is.

133
00:07:29,580 --> 00:07:31,000
Then, well, if I is nine.

134
00:07:31,150 --> 00:07:32,140
Initially it was it.

135
00:07:32,530 --> 00:07:39,430
Now, after I please, Preston, you will if I is nine c0 day so nine will be printed I plus plus.

136
00:07:39,700 --> 00:07:41,320
So anyway if I is ten.

137
00:07:41,920 --> 00:07:42,670
So ten.

138
00:07:42,790 --> 00:07:45,220
Eleven, twelve then again.

139
00:07:45,220 --> 00:07:47,230
Thirteen, fourteen, fifteen.

140
00:07:47,590 --> 00:07:51,940
And when the value of I will become sixteen this condition will again become true.

141
00:07:51,940 --> 00:07:53,780
And the value if I will become a 17.

142
00:07:54,340 --> 00:07:58,760
Then you will print the value of eight or seventeen will get printed and the value of I.

143
00:07:58,800 --> 00:08:01,060
So 18, 19 and 20.

144
00:08:01,750 --> 00:08:03,360
So in this output only.

145
00:08:03,840 --> 00:08:07,220
So from two to twenty two numbers are missing.

146
00:08:07,240 --> 00:08:08,710
And what are those two numbers?

147
00:08:09,280 --> 00:08:13,240
Those two numbers are eight and sixteen.

148
00:08:14,040 --> 00:08:21,160
Okay, so Marlboro will be starting from two till twenty and eight and sixteen should not be there.

149
00:08:21,700 --> 00:08:26,000
So let's see whether that outpoured that I hold in later is correct or not.

150
00:08:29,940 --> 00:08:33,820
So starting from two till 20, no, it is missing.

151
00:08:34,290 --> 00:08:36,990
And similarly, number 16 is missing.

152
00:08:37,560 --> 00:08:39,240
So I have generated the correct output.

153
00:08:39,660 --> 00:08:42,030
Now, let us use brake statement here.

154
00:08:43,790 --> 00:08:50,210
So, for example, let's use a big statement here, I please press, then I'm using vague statement.

155
00:08:51,050 --> 00:08:52,040
So what will happen?

156
00:08:52,880 --> 00:08:56,450
So this condition will become true.

157
00:08:56,780 --> 00:08:58,000
When I will become it.

158
00:08:58,490 --> 00:08:58,800
OK.

159
00:08:59,060 --> 00:09:02,960
So that means two, three, four, five, six, seven.

160
00:09:03,500 --> 00:09:05,260
This will be normal, Brent.

161
00:09:05,810 --> 00:09:06,960
Now I become saved.

162
00:09:07,140 --> 00:09:07,370
Okay.

163
00:09:07,970 --> 00:09:08,960
So I become saved.

164
00:09:09,110 --> 00:09:10,350
I please press the media.

165
00:09:10,350 --> 00:09:15,530
If I become s9 brick no brick statement get executed.

166
00:09:15,560 --> 00:09:16,340
What will happen.

167
00:09:16,760 --> 00:09:23,630
I will reach at line number 17 and then I will execute the program.

168
00:09:23,750 --> 00:09:24,040
Okay.

169
00:09:24,440 --> 00:09:25,970
I will reach line number 17.

170
00:09:26,030 --> 00:09:27,440
Then I will exit your deprogram.

171
00:09:27,740 --> 00:09:28,400
One more time.

172
00:09:28,840 --> 00:09:29,540
What will happen.

173
00:09:30,990 --> 00:09:31,890
So what will happen?

174
00:09:33,240 --> 00:09:40,480
This statement, this condition will only be true when the value of five will become eight or 16.

175
00:09:41,100 --> 00:09:45,270
So two, three, four, five, six and seven will be printed.

176
00:09:45,600 --> 00:09:47,270
Now, the value of high is eight.

177
00:09:47,640 --> 00:09:49,230
So this condition becomes true.

178
00:09:49,860 --> 00:09:53,670
If this condition is true, I will go inside increment value of face with a new way.

179
00:09:53,690 --> 00:09:58,470
If I we become nine, then break statement is getting executed.

180
00:09:59,010 --> 00:10:00,180
So what will break do?

181
00:10:00,780 --> 00:10:03,930
The function of break is to break the loop.

182
00:10:04,470 --> 00:10:05,880
So it will break the loop.

183
00:10:06,120 --> 00:10:07,630
So which is the closest loop.

184
00:10:08,010 --> 00:10:09,930
I think Viall is the only loop.

185
00:10:10,590 --> 00:10:13,320
So this loop will be the closest to the innermost loop.

186
00:10:13,680 --> 00:10:15,450
So this very loop will be broken.

187
00:10:15,720 --> 00:10:21,450
And I will reach at the end of the VI looked at this line number 17, and then I will execute the rest

188
00:10:21,450 --> 00:10:22,320
of the instructions.

189
00:10:22,770 --> 00:10:27,480
So I think my output should be this only two, three, four, five, six and seven.

190
00:10:27,960 --> 00:10:30,600
So let's see where they have generated the correct output or not.

191
00:10:34,110 --> 00:10:38,010
So two, three, four, five, six and seven is the output.

192
00:10:38,730 --> 00:10:39,030
OK.

193
00:10:39,510 --> 00:10:45,180
So the functionality of the break is to break loops and which loop in their most loop.

194
00:10:46,080 --> 00:10:46,330
OK.

195
00:10:47,400 --> 00:10:48,680
So that is it for this video.

196
00:10:48,780 --> 00:10:50,490
If you have any doubt, feel free to ask.

197
00:10:50,820 --> 00:10:51,380
Thank you.
