1
00:00.800 --> 00:04.700
So yesterday we have seen the conditional split.

2
00:04.730 --> 00:07.220
Now see the looping concepts.

3
00:08.390 --> 00:13.310
So we have while loop is available in SQL server for looping purpose.

4
00:13.670 --> 00:22.820
So loops are used for loops are used to execute statements repeatedly repeatedly multiple times.

5
00:23.060 --> 00:30.380
So whenever you want to do some repeat operations multiple times at that time we are using the while

6
00:30.380 --> 00:32.930
loop right now.

7
00:32.960 --> 00:37.640
Normal syntax for a while loop is while condition.

8
00:37.670 --> 00:42.740
So over here we are checking the condition and it will be either.

9
00:44.870 --> 00:45.860
True or false.

10
00:45.860 --> 00:46.130
Right?

11
00:46.130 --> 00:48.290
It will be either true or false.

12
00:48.680 --> 00:49.850
If it is true.

13
00:49.880 --> 00:53.270
If it is true, then it will enter into the begin statement.

14
00:53.270 --> 00:58.010
Begin block and it will run all the statement which is reside inside.

15
00:58.430 --> 01:00.780
Begin block and then end.

16
01:00.810 --> 01:03.360
We have to write because we have written over here.

17
01:03.390 --> 01:04.170
Begin.

18
01:04.260 --> 01:10.470
So whenever we have write begin, we have to specify respective end.

19
01:12.930 --> 01:15.660
And for every begin write.

20
01:16.290 --> 01:20.580
So this is how while loop is uh syntax is there.

21
01:21.090 --> 01:24.300
Now the condition should result in true or false.

22
01:24.300 --> 01:24.930
Right.

23
01:25.320 --> 01:30.630
And if the condition is true, the loop continues.

24
01:31.080 --> 01:34.560
And if the condition is false, then loop terminates.

25
01:34.590 --> 01:40.260
So now if the if this condition is false now it will not enter into this begin block.

26
01:40.260 --> 01:44.340
It will directly go outside this end block.

27
01:44.340 --> 01:48.360
If the condition is false, it will not run any statement right.

28
01:49.110 --> 01:51.780
Now simple example of loop.

29
01:51.780 --> 01:57.360
We can say we have to print something multiple times, right?

30
01:57.390 --> 02:00.270
If we want to print something multiple times.

31
02:00.270 --> 02:07.830
So ideally, if if we do not know the concept of loop then what we have to do.

32
02:07.860 --> 02:09.570
We are writing like this.

33
02:09.570 --> 02:10.380
Hello.

34
02:13.470 --> 02:14.250
Hello world.

35
02:14.250 --> 02:15.000
Hello world.

36
02:19.350 --> 02:21.810
1010 times we are writing, right?

37
02:21.900 --> 02:24.930
Ten times we are writing hello world, hello world.

38
02:24.960 --> 02:28.080
If we do not know the concept of loop.

39
02:28.140 --> 02:30.600
So ideally this is a wrong thing, right?

40
02:30.600 --> 02:32.460
This is a wrong thing.

41
02:32.580 --> 02:42.120
So to print the same result, what we are doing over here see for the loop purpose we need to declare

42
02:42.120 --> 02:43.380
some variable right?

43
02:44.700 --> 02:48.810
So here we have declared the variable count as integer.

44
02:50.250 --> 02:53.580
This if you specify here as then also fine.

45
02:53.610 --> 03:00.730
If you do not specify s, then also fine Now this loop will be starting from one.

46
03:01.900 --> 03:04.870
We want to start a loop from one, right.

47
03:04.960 --> 03:06.040
So it will.

48
03:06.490 --> 03:07.720
We have initiated.

49
03:07.720 --> 03:09.280
So this is known as.

50
03:12.070 --> 03:18.640
Any serialization of a variable.

51
03:18.910 --> 03:20.680
Initialization of a variable.

52
03:20.710 --> 03:21.280
Right.

53
03:23.620 --> 03:29.230
At the same time we have declared the variable.

54
03:29.260 --> 03:29.590
Right.

55
03:29.590 --> 03:31.960
At the same time we have declared the variable.

56
03:34.690 --> 03:41.020
Or if we do not do like this then what we can do we can set the variable value like this.

57
03:41.020 --> 03:41.560
Right.

58
03:41.830 --> 03:45.850
Set it count equal to one.

59
03:47.200 --> 03:48.940
This is also another way right?

60
03:48.940 --> 03:50.950
This is also one another way.

61
03:53.560 --> 03:59.950
So let me Now over here, we this is our looping condition.

62
03:59.950 --> 04:07.900
Or we can say that exit condition, when this particular loop will exit, when this particular loop

63
04:07.900 --> 04:13.690
will exist, when count accurate, count less than equal to ten.

64
04:14.320 --> 04:16.600
When accurate count less than equal to ten.

65
04:16.630 --> 04:18.700
At that time it will exit this condition.

66
04:18.700 --> 04:22.330
Right now we have declared the begin statement.

67
04:22.330 --> 04:24.670
Begin inside the begin.

68
04:24.670 --> 04:26.440
We are just printing hello world!

69
04:27.430 --> 04:32.170
But now suppose if we are, do not writing this condition.

70
04:32.200 --> 04:35.110
Now, what will happen if we are?

71
04:35.140 --> 04:36.490
Do not write this condition.

72
04:36.490 --> 04:37.360
Then what will happen?

73
04:37.390 --> 04:37.960
See?

74
04:43.570 --> 04:45.610
It is executing query exit.

75
04:45.610 --> 04:52.030
It is showing us as executing query but not displaying any output.

76
04:52.090 --> 05:01.940
Why Because this one will be always less than or equal to ten, right?

77
05:01.970 --> 05:04.850
One will be always less than or equal to ten.

78
05:05.390 --> 05:07.880
We are not incrementing the value of one.

79
05:07.880 --> 05:08.180
Right?

80
05:08.210 --> 05:11.510
123456789 ten.

81
05:11.750 --> 05:15.200
So this condition will always be true.

82
05:17.900 --> 05:19.700
Let me stop the query.

83
05:21.080 --> 05:28.340
In this case, this condition will always true.

84
05:28.340 --> 05:38.000
And that is why it is not going to be exit.

85
05:38.000 --> 05:38.270
Right.

86
05:38.300 --> 05:40.160
It is not going to be exit.

87
05:40.550 --> 05:44.180
So now we have to increment the value of one.

88
05:44.330 --> 05:50.600
First time we have to mention one then 23456789 ten.

89
05:52.310 --> 05:59.580
Now Using this set keyword, we are incrementing the value at the rate count equal to count plus one.

90
05:59.610 --> 06:03.030
So at first iteration it will be the value of one.

91
06:03.930 --> 06:04.590
Right?

92
06:04.620 --> 06:07.290
At first iteration it will be the value of one.

93
06:07.650 --> 06:10.560
Then second iteration 234.

94
06:10.740 --> 06:12.750
It will print like this.

95
06:13.290 --> 06:16.410
And when it is ten so ten less than equal to ten.

96
06:16.410 --> 06:17.130
True.

97
06:17.700 --> 06:18.450
Right.

98
06:18.450 --> 06:24.480
So ten times 123456789 1010 times it will print.

99
06:24.510 --> 06:26.820
Hello world, hello world, hello world hello world.

100
06:33.630 --> 06:34.590
Right.

101
06:37.050 --> 06:40.530
When, when it will increment the value of 11.

102
06:40.530 --> 06:41.340
So 11.

103
06:41.340 --> 06:42.990
When when it is a ten.

104
06:42.990 --> 06:43.920
Over here.

105
06:45.270 --> 06:46.860
Sorry ten over here.

106
06:46.860 --> 06:49.740
And it will increment the value to ten plus one.

107
06:49.740 --> 06:51.780
So when 11 is come over here.

108
06:51.810 --> 06:54.000
So 11 less than or equal to ten.

109
06:54.150 --> 06:55.500
It is false, right?

110
06:55.500 --> 06:56.640
It is false.

111
06:56.700 --> 06:59.460
So at that time it will not print hello world.

112
06:59.460 --> 07:00.840
It will not print hello world.

113
07:00.840 --> 07:02.760
And it is exit the condition.

114
07:05.640 --> 07:06.690
Right.

115
07:09.840 --> 07:13.410
Now let us see one more thing.

116
07:15.000 --> 07:16.050
Ensure.

117
07:22.320 --> 07:28.350
Ensure to mention a statement which can cause condition to become false.

118
07:28.860 --> 07:32.070
So this is that particular statement.

119
07:35.310 --> 07:42.330
As per your requirement, if your if condition never becomes false, then it will become an infinite

120
07:42.360 --> 07:42.990
loop.

121
07:43.020 --> 07:50.100
So if we do not specify this condition then it will become what it will become infinite loop and it

122
07:50.100 --> 07:51.910
will never going to be end.

123
07:52.780 --> 07:56.800
It will never going to be end if we do not specify this condition.

124
07:56.800 --> 08:01.600
This condition in loop will never terminate, right?

125
08:01.690 --> 08:03.970
Loop will never terminate.

126
08:05.470 --> 08:12.340
Write a program to print the numbers one, 23456789 ten.

127
08:14.350 --> 08:17.050
This time we are going to print the numbers, right?

128
08:17.080 --> 08:19.540
This time we are going to print the numbers.

129
08:19.750 --> 08:27.520
So now this is at the rate I equal to one while I less than equal to ten.

130
08:27.550 --> 08:30.010
So this is the exit condition right.

131
08:34.240 --> 08:35.680
Begin print I.

132
08:35.890 --> 08:39.340
Now we have to increment the value also for this I right.

133
08:39.370 --> 08:41.770
First time one we have to print.

134
08:41.800 --> 08:43.810
Second time two we have to print.

135
08:43.840 --> 08:47.710
Third time three we have to print like this.

136
08:47.710 --> 08:51.590
So 6789 ten C.

137
08:54.710 --> 08:56.150
So what will happen initially?

138
08:56.180 --> 08:57.080
Initially it will.

139
08:57.110 --> 08:58.280
You have one right.

140
08:58.340 --> 09:01.700
So it will come over here one less than equal to ten.

141
09:01.730 --> 09:02.570
True.

142
09:02.630 --> 09:04.250
It will print one.

143
09:10.820 --> 09:12.710
It will print one right.

144
09:12.740 --> 09:14.210
It will print one.

145
09:14.240 --> 09:24.110
Now it will set the value of one equal to one plus one.

146
09:25.490 --> 09:30.050
So at the rate I equal to iterate I equal to one plus one.

147
09:30.050 --> 09:32.480
So it will become two right.

148
09:32.480 --> 09:34.250
It will become two next time.

149
09:35.150 --> 09:42.200
Then third time it will be over here two now two less than equal to ten.

150
09:42.200 --> 09:43.040
True.

151
09:43.460 --> 09:45.590
So two plus one.

152
09:45.590 --> 09:50.270
It will become three when it arrives to ten.

153
09:50.270 --> 09:52.130
So ten less than equal to ten.

154
09:52.130 --> 09:52.940
True.

155
09:56.300 --> 09:58.100
So it will print ten over here.

156
09:58.100 --> 09:58.700
Right.

157
09:58.940 --> 10:01.580
But when it will do ten plus 111.

158
10:01.580 --> 10:03.830
So 11 less than equal to ten.

159
10:03.830 --> 10:04.580
No.

160
10:05.990 --> 10:09.980
This condition 11 less than equal to ten.

161
10:09.980 --> 10:10.790
False.

162
10:13.610 --> 10:15.020
It will exit the loop.

163
10:15.020 --> 10:15.590
Right.

164
10:17.030 --> 10:18.530
It will exit the loop.

165
10:18.530 --> 10:20.120
And do not print anything.

166
10:20.150 --> 10:21.410
Do not print anything.

167
10:21.440 --> 10:22.040
Right.

168
10:26.360 --> 10:28.130
Now let's see one more example.

169
10:28.160 --> 10:31.460
Write a program to print one, 2345.

170
10:31.790 --> 10:38.060
See over here what we have written 123456 is missing right?

171
10:38.090 --> 10:39.890
Six is missing.

172
10:39.920 --> 10:41.750
Seven, eight, nine, ten.

173
10:43.550 --> 10:45.920
So for that purpose we have to write.

174
10:45.950 --> 10:48.330
We have to use continue your statement.

175
10:48.360 --> 10:50.040
What will you do?

176
10:50.070 --> 10:57.420
This statement is used to skip current iteration or skip the statements mentioned after the continue

177
10:57.450 --> 10:59.280
for the current iteration.

178
11:03.480 --> 11:04.290
Wrong.

179
11:04.320 --> 11:05.220
Infinite loop.

180
11:05.250 --> 11:09.780
Okay, so now see how this is going to be infinite loop.

181
11:09.780 --> 11:14.850
See over here 12345.

182
11:15.690 --> 11:17.910
But after that nothing is printed.

183
11:17.940 --> 11:18.600
See.

184
11:20.370 --> 11:21.990
After that nothing is printed.

185
11:21.990 --> 11:23.490
So what is the issue over here?

186
11:23.520 --> 11:26.730
Let me explain.

187
11:26.730 --> 11:31.350
It is initially starting with one one less than equal to ten.

188
11:31.380 --> 11:31.770
True.

189
11:31.800 --> 11:32.430
Right.

190
11:33.390 --> 11:38.250
So begin if iterate I equal to six.

191
11:38.250 --> 11:47.190
So over here what is the value of I at the rate I equal to one.

192
11:47.220 --> 11:48.720
It is a false right.

193
11:48.720 --> 11:51.270
So print print one.

194
11:51.270 --> 11:52.860
So it will print one.

195
11:54.360 --> 11:58.530
Now it will going to be increase one plus one two.

196
11:59.820 --> 12:01.740
So now two less than equal to ten.

197
12:01.740 --> 12:02.580
True.

198
12:02.580 --> 12:07.800
So now at rate I value will be two.

199
12:10.440 --> 12:12.090
So two equal to six.

200
12:12.090 --> 12:13.320
No no.

201
12:13.320 --> 12:15.750
So it will not continue.

202
12:15.780 --> 12:17.250
It will directly print.

203
12:19.980 --> 12:22.260
It will directly print at the rate I.

204
12:22.290 --> 12:24.510
So it will print two.

205
12:27.600 --> 12:28.710
Then same.

206
12:35.940 --> 12:36.990
One minute.

207
12:47.170 --> 12:48.670
Okay, now let's see.

208
12:48.670 --> 12:53.710
Uh, over here, it will be print two right now.

209
12:53.740 --> 12:54.790
Same for three.

210
12:54.820 --> 12:55.810
Four now.

211
12:55.810 --> 12:56.560
Five.

212
12:56.650 --> 12:58.660
So when five will come.

213
12:59.020 --> 13:01.810
Three, four, five.

214
13:01.840 --> 13:02.950
Less than equal to ten.

215
13:02.950 --> 13:03.340
True.

216
13:03.370 --> 13:04.030
Right.

217
13:04.450 --> 13:05.620
Now begin.

218
13:05.620 --> 13:07.030
If five equal to six.

219
13:07.030 --> 13:07.840
False.

220
13:07.840 --> 13:12.820
So now at the rate I equal to five it will false.

221
13:13.150 --> 13:17.350
So it will print five it will print five.

222
13:18.010 --> 13:22.540
Now when six will come what will happen now.

223
13:22.570 --> 13:24.910
Five plus one over here.

224
13:25.270 --> 13:27.400
Five plus one.

225
13:27.400 --> 13:28.450
It is six.

226
13:28.510 --> 13:31.630
So this value will become now six.

227
13:32.440 --> 13:33.010
Six.

228
13:33.010 --> 13:34.300
Less than equal to ten.

229
13:34.300 --> 13:34.960
Right.

230
13:34.990 --> 13:35.830
Correct.

231
13:35.920 --> 13:39.310
Now begin if six equal to six.

232
13:39.310 --> 13:43.870
So over here six equal to six.

233
13:44.240 --> 13:45.110
Correct.

234
13:45.140 --> 13:45.500
Right.

235
13:45.530 --> 13:46.250
True.

236
13:46.700 --> 13:48.350
Now what will happen?

237
13:49.250 --> 13:50.570
Continue.

238
13:51.530 --> 14:00.230
So now this statement is used to skip the current iteration, or to skip the statements mentioned after

239
14:00.230 --> 14:02.930
the continue for the current iteration.

240
14:03.560 --> 14:07.010
So it will not execute all of this statement.

241
14:07.040 --> 14:10.130
It will skip all of these statements.

242
14:11.240 --> 14:14.120
So it is never going to increase this value.

243
14:14.150 --> 14:16.940
It is never going to be increase this value.

244
14:16.970 --> 14:18.860
Six plus one.

245
14:18.860 --> 14:20.330
It will never happen.

246
14:22.250 --> 14:24.680
So always it will be.

247
14:26.720 --> 14:27.980
Six only.

248
14:27.980 --> 14:28.670
Right.

249
14:29.000 --> 14:31.070
Always six equal to six.

250
14:31.070 --> 14:31.580
Always.

251
14:31.580 --> 14:33.170
This condition will be true.

252
14:33.320 --> 14:36.350
And it will never run this statement.

253
14:36.350 --> 14:42.080
And it will never exit this loop because it is not going to be seven over here.

254
14:42.740 --> 14:45.110
It is not going to be seven over here.

255
14:45.110 --> 14:47.630
So it is never exit this loop.

256
14:48.200 --> 14:50.870
That is why this is infinite loop.

257
14:52.940 --> 14:55.280
That is why this is infinite loop.

258
14:57.680 --> 15:00.140
Now let me know if you have any question.

259
15:00.140 --> 15:01.310
One minute.

260
15:13.940 --> 15:14.240
Okay.

261
15:14.240 --> 15:14.540
Yeah.

262
15:14.570 --> 15:16.880
Now you can ask any question if you have.

263
15:21.230 --> 15:22.700
See over here.

264
15:22.700 --> 15:23.900
This is infinite loop.

265
15:23.900 --> 15:26.570
This is never going to what will happen.

266
15:27.050 --> 15:27.920
Okay

267
15:45.600 --> 15:47.040
And this red button.

268
15:47.040 --> 15:48.150
We have to stop.

269
15:49.230 --> 15:50.790
Cancel execution.

270
15:50.820 --> 15:51.720
Executing query.

271
15:51.750 --> 15:54.300
We have to click this button so it will stop.

272
15:59.580 --> 16:01.920
Now what is the.

273
16:01.950 --> 16:02.220
Sorry.

274
16:02.250 --> 16:03.210
Can you say it again?

275
16:03.240 --> 16:03.720
I'm sorry.

276
16:03.750 --> 16:04.560
Can you say it again?

277
16:04.590 --> 16:06.360
One which you told a minute back.

278
16:08.250 --> 16:09.060
Yes.

279
16:09.240 --> 16:09.780
This.

280
16:09.780 --> 16:10.680
This red button.

281
16:10.680 --> 16:11.550
Red button.

282
16:11.550 --> 16:13.530
Cancel executing query.

283
16:18.990 --> 16:19.800
We have to click.

284
16:19.830 --> 16:20.220
Got it.

285
16:20.460 --> 16:21.840
Krishna also told the same.

286
16:21.840 --> 16:22.650
Thank you so much.

287
16:22.680 --> 16:23.670
Thanks, Krishna.

288
16:26.190 --> 16:28.950
Now what is the correct solution for this one?

289
16:28.980 --> 16:31.200
See now the.

290
16:32.010 --> 16:36.090
We want to do not want to print only six.

291
16:36.450 --> 16:38.880
Apart from everything we want to print, right?

292
16:38.910 --> 16:39.210
One.

293
16:39.210 --> 16:39.390
Two.

294
16:39.420 --> 16:39.630
Three.

295
16:39.660 --> 16:39.900
Four.

296
16:39.930 --> 16:40.290
Five.

297
16:40.290 --> 16:40.650
Seven.

298
16:40.680 --> 16:40.890
Eight.

299
16:40.890 --> 16:44.910
789 ten 12345.

300
16:44.940 --> 16:45.150
Seven.

301
16:45.180 --> 16:45.300
Eight.

302
16:45.330 --> 16:45.570
Nine.

303
16:45.570 --> 16:46.110
Ten.

304
16:46.140 --> 16:48.660
So for this purpose, see what?

305
16:49.380 --> 16:50.820
This is a solution.

306
16:50.970 --> 16:53.640
Now over here it will start with zero.

307
16:54.240 --> 16:56.370
Over here it will start with zero.

308
16:56.400 --> 16:58.560
So firstly it will be zero right.

309
16:58.590 --> 16:59.880
It will be zero.

310
17:00.450 --> 17:01.230
Now zero.

311
17:01.230 --> 17:02.070
Less than ten.

312
17:02.070 --> 17:02.880
True.

313
17:03.660 --> 17:04.740
So begin.

314
17:06.120 --> 17:10.560
Now set it I equal to I plus one.

315
17:11.130 --> 17:12.900
So what will happen over here?

316
17:14.400 --> 17:16.590
Zero zero.

317
17:16.590 --> 17:20.700
Equal to zero plus one.

318
17:20.700 --> 17:22.260
So it will become one.

319
17:23.370 --> 17:26.010
Now one is equal to six.

320
17:26.430 --> 17:27.600
False.

321
17:28.110 --> 17:30.150
So it will go to the begin.

322
17:32.130 --> 17:34.470
And it will not execute this one.

323
17:34.470 --> 17:37.350
It will directly come over here print at the rate I.

324
17:38.100 --> 17:38.640
So what.

325
17:38.640 --> 17:40.820
It will print it will print.

326
17:42.740 --> 17:44.270
It will print one.

327
17:45.020 --> 17:46.520
It will print one.

328
17:46.550 --> 17:49.760
Now again it will come over here.

329
17:51.110 --> 17:52.970
One less than equal to ten.

330
17:53.000 --> 17:53.810
True.

331
17:55.190 --> 17:58.640
Now it will do what it will do.

332
17:58.670 --> 18:02.600
One equal to one plus one.

333
18:03.200 --> 18:04.880
So it will become two.

334
18:05.540 --> 18:08.240
Now it will check two equal to six.

335
18:08.270 --> 18:11.750
No, it will not going to be continue.

336
18:11.780 --> 18:16.160
It will end this statement and it will print what it will print.

337
18:16.190 --> 18:18.680
It will print two.

338
18:20.510 --> 18:22.430
Now when five will come.

339
18:22.460 --> 18:22.820
Same.

340
18:22.820 --> 18:23.090
Four.

341
18:23.090 --> 18:23.330
Three.

342
18:23.360 --> 18:23.720
Four.

343
18:23.750 --> 18:25.940
Now let's when five will come.

344
18:26.390 --> 18:28.880
So five less than equal to ten.

345
18:29.570 --> 18:30.470
True.

346
18:31.190 --> 18:33.410
Now what will happen over here?

347
18:33.680 --> 18:34.370
Five.

348
18:34.400 --> 18:37.010
Equal to five plus one.

349
18:37.220 --> 18:38.450
Six.

350
18:38.480 --> 18:38.960
Right?

351
18:38.990 --> 18:39.890
Six.

352
18:40.460 --> 18:41.600
Now see?

353
18:42.080 --> 18:42.710
Six.

354
18:42.710 --> 18:43.190
Equal to.

355
18:43.220 --> 18:43.970
Six.

356
18:45.140 --> 18:46.100
True.

357
18:46.670 --> 18:48.860
It will go over here.

358
18:48.860 --> 18:49.610
Begin.

359
18:49.700 --> 18:51.380
It will continue.

360
18:51.890 --> 18:53.510
Continue means what?

361
18:53.540 --> 18:56.090
It will skip all this statement.

362
18:56.120 --> 18:58.220
It will skip all this statement.

363
18:58.250 --> 19:00.260
It will not print six.

364
19:00.890 --> 19:03.410
It will not print six.

365
19:04.340 --> 19:06.920
Now again it will come over here.

366
19:07.070 --> 19:09.560
What is the value of edit I.

367
19:11.180 --> 19:11.930
Edit I.

368
19:11.960 --> 19:13.970
Value is now six.

369
19:15.260 --> 19:16.040
Edit I.

370
19:16.070 --> 19:17.120
Value is now six.

371
19:17.120 --> 19:17.840
So six.

372
19:17.840 --> 19:18.590
Less than ten.

373
19:18.590 --> 19:19.310
True.

374
19:19.940 --> 19:21.740
Now what will happen over here?

375
19:21.770 --> 19:23.000
Six.

376
19:23.000 --> 19:26.720
Equal to six plus one seven.

377
19:28.610 --> 19:30.440
So it will check seven.

378
19:30.440 --> 19:31.310
Equal to six.

379
19:31.310 --> 19:32.180
No.

380
19:33.230 --> 19:36.050
It will print seven.

381
19:38.060 --> 19:39.500
Five is printed.

382
19:39.530 --> 19:40.910
Six is not printed.

383
19:40.940 --> 19:42.530
Now it will print seven.

384
19:45.020 --> 19:46.580
Six is not printed.

385
19:46.580 --> 19:47.150
Right?

386
19:47.180 --> 19:49.160
Now same for eight, nine, ten.

387
19:49.190 --> 19:50.120
When it will come?

388
19:50.540 --> 19:51.200
Nine.

389
19:51.380 --> 19:53.480
What it will do nine.

390
19:53.510 --> 19:54.470
Less than ten.

391
19:54.470 --> 19:55.190
True.

392
19:55.820 --> 19:56.600
Then nine.

393
19:56.600 --> 19:57.620
Equal to nine.

394
19:57.620 --> 20:00.020
Equal to nine plus one.

395
20:00.080 --> 20:01.010
Ten.

396
20:01.310 --> 20:01.820
Ten.

397
20:01.820 --> 20:02.600
Equal to six.

398
20:02.600 --> 20:03.530
False.

399
20:03.950 --> 20:07.100
It will print ten.

400
20:08.180 --> 20:08.690
Sorry.

401
20:08.720 --> 20:12.140
Eight, nine and ten.

402
20:13.310 --> 20:14.150
Now ten.

403
20:14.150 --> 20:14.930
Less than ten.

404
20:14.960 --> 20:15.740
False.

405
20:15.740 --> 20:18.110
So it will not enter over here.

406
20:19.580 --> 20:23.270
So when I execute this one see what will happen.

407
20:25.520 --> 20:26.900
Oh my God

408
20:44.220 --> 20:45.810
Now see what will happen.

409
20:45.810 --> 20:51.900
123456789

410
20:51.900 --> 20:52.650
ten.

411
20:57.090 --> 21:01.080
You have to understand the use of continuum.

412
21:02.370 --> 21:04.980
You have to understand the use of continue.

413
21:06.840 --> 21:08.580
That is main over here.

414
21:09.210 --> 21:12.390
Now let's move forward.

415
21:15.570 --> 21:17.400
Now same for continue.

416
21:17.430 --> 21:19.200
We have a break statement as well.

417
21:19.230 --> 21:20.280
Same for continue.

418
21:20.310 --> 21:22.080
We have a break statement as well.

419
21:22.470 --> 21:27.540
This statement is used to get out of the loop as per our requirement.

420
21:27.930 --> 21:33.540
This statement exits the while loop immediately when break statement is encountered.

421
21:34.110 --> 21:36.720
Get out of the loop after five.

422
21:37.260 --> 21:39.540
Get out of the loop after five.

423
21:39.570 --> 21:42.390
So see over here what will happen?

424
21:43.380 --> 21:44.130
How much?

425
21:44.130 --> 21:45.420
I will explain you later.

426
21:45.450 --> 21:45.930
See?

427
21:45.960 --> 21:47.730
12345.

428
21:47.760 --> 21:50.040
Only 12345 is printed.

429
21:50.460 --> 21:56.430
Now let understand what is the value of Ethernet I initially it is one right?

430
21:57.510 --> 21:58.920
Initially it is one.

431
21:59.700 --> 22:03.480
This condition is true print I.

432
22:03.510 --> 22:05.190
So it will print one.

433
22:06.840 --> 22:10.080
It will print one one equal to five.

434
22:10.110 --> 22:10.830
No.

435
22:10.830 --> 22:11.760
Begin.

436
22:13.230 --> 22:15.000
This will not happen over here.

437
22:15.000 --> 22:16.140
It will set.

438
22:16.530 --> 22:19.800
Set the value of one equal to one plus one.

439
22:19.800 --> 22:21.030
It will become two.

440
22:22.320 --> 22:25.020
It it I will become two now.

441
22:25.050 --> 22:26.790
Two less than equal to ten.

442
22:27.360 --> 22:29.010
Two less than equal to ten.

443
22:29.520 --> 22:30.360
True.

444
22:30.390 --> 22:34.630
So it will print at the rate two it will print two.

445
22:35.500 --> 22:38.290
Now same for three.

446
22:38.320 --> 22:38.890
Four.

447
22:38.920 --> 22:41.470
Now, when five will arrive.

448
22:43.150 --> 22:44.050
So five.

449
22:44.080 --> 22:45.520
Less than equal to ten.

450
22:45.550 --> 22:46.360
True.

451
22:47.650 --> 22:49.360
It will print five.

452
22:49.390 --> 22:50.800
It will print five.

453
22:52.570 --> 22:54.070
Now it will check five.

454
22:54.100 --> 22:55.210
Equal to five.

455
22:56.080 --> 22:58.390
Yes, it will print five.

456
22:58.420 --> 22:59.410
Equal to five.

457
22:59.650 --> 23:00.400
Yes.

458
23:00.400 --> 23:01.720
So it will break.

459
23:01.960 --> 23:04.480
It will automatically exit the loop.

460
23:05.020 --> 23:06.700
It will never increment.

461
23:07.630 --> 23:09.730
It will never increment five plus one.

462
23:09.730 --> 23:11.620
It will never increment right.

463
23:12.310 --> 23:16.840
Break statement is used to get out of the loop as per our requirement.

464
23:16.870 --> 23:20.530
So when it is a five it will getting out of the loop.

465
23:22.630 --> 23:27.370
This statement exits the while loop immediately when the break statement is encountered.

466
23:28.300 --> 23:30.490
So it will print 12345.

467
23:30.520 --> 23:31.240
Only

468
23:35.060 --> 23:42.890
Okay, I'm writing actually this thing every time it will print one, two, three, four, five only.

469
23:44.780 --> 23:45.620
See?

470
23:47.960 --> 23:52.100
You have to understand the use of continue and break statement.

471
23:56.600 --> 23:59.330
Now, the interesting thing will come.

472
24:00.830 --> 24:02.720
Let me show you.

473
24:02.750 --> 24:09.080
Write a program to input a string and print the following pattern.

474
24:10.250 --> 24:19.250
What I want to input Harshit and my output will be h a r s h I t like this.

475
24:24.230 --> 24:26.060
H a r s h I t.

476
24:26.090 --> 24:26.690
Right.

477
24:28.970 --> 24:35.930
Now, understand the thing We have to store this value into some variable, right?

478
24:36.140 --> 24:36.950
We have to.

479
24:36.980 --> 24:39.920
Store this value into some variable.

480
24:39.920 --> 24:43.550
So for that purpose I have declared at the rate s.

481
24:45.890 --> 24:51.950
Declare at the rate s equal to where care worker of 20.

482
24:52.400 --> 24:53.720
Worker of 20.

483
24:53.720 --> 24:55.850
And now I have to increment the.

484
24:56.510 --> 24:59.570
At first iteration I want to print h.

485
25:00.620 --> 25:03.440
In second iteration I want to print a.

486
25:03.740 --> 25:11.450
So I, I want to increase increment the value of iteration.

487
25:11.450 --> 25:14.360
Right 1234567.

488
25:14.390 --> 25:15.050
Right.

489
25:15.440 --> 25:20.720
So for that purpose I have declared this variable at the rate x integer equal to one.

490
25:23.180 --> 25:27.500
Now we have set the value of x with harshit right

491
25:30.780 --> 25:33.810
We have set the value of a set S equal to one.

492
25:34.710 --> 25:38.370
Now I have to specify some exit condition.

493
25:40.680 --> 25:44.940
I want to actually let me write like this.

494
25:51.180 --> 25:53.760
When the loop is going to be exit.

495
25:55.200 --> 26:01.470
So over here when the loop is going to be exit while at that x value.

496
26:01.560 --> 26:09.120
Why this iterate x value is less than equal to length of this harshit.

497
26:09.510 --> 26:11.460
What is the length of this Harshit.

498
26:11.490 --> 26:16.890
Select length of Harshit.

499
26:17.490 --> 26:21.810
What is the length of this particular string?

500
26:22.110 --> 26:24.630
See over here our length is seven.

501
26:25.920 --> 26:27.510
Harshit length is seven.

502
26:27.540 --> 26:29.190
So what is this?

503
26:29.200 --> 26:32.290
Ideally, it will be over here.

504
26:32.290 --> 26:33.100
Seven.

505
26:33.910 --> 26:34.690
Over here.

506
26:34.690 --> 26:35.410
Seven.

507
26:37.660 --> 26:39.250
But this seven.

508
26:39.250 --> 26:40.450
We do not want to.

509
26:40.480 --> 26:41.260
Static value.

510
26:41.290 --> 26:41.920
Right.

511
26:43.120 --> 26:44.470
What if tomorrow.

512
26:44.470 --> 26:45.190
Over here.

513
26:45.190 --> 26:47.110
Some someone like this.

514
26:48.760 --> 26:52.060
Then this value will be become five.

515
26:52.090 --> 26:52.450
Right?

516
26:52.450 --> 26:54.280
This value will become five.

517
26:54.670 --> 27:00.280
So we cannot keep the value of s variable as static, right?

518
27:00.280 --> 27:04.930
We cannot keep the value of exit condition as static.

519
27:05.410 --> 27:08.200
And that is why we have mentioned over here.

520
27:10.510 --> 27:13.960
Length of Athreat s.

521
27:13.990 --> 27:15.220
Now begin.

522
27:17.350 --> 27:18.700
Now begin.

523
27:19.540 --> 27:22.870
Now understand thing over here.

524
27:22.870 --> 27:27.220
If we print over here at the rate x

525
27:31.690 --> 27:33.790
Print edit.

526
27:46.570 --> 27:53.350
See, I have printed only at the rate s, so it is printing over here.

527
27:54.850 --> 27:56.410
It is printing over here.

528
27:56.440 --> 27:56.830
Hershey.

529
27:56.860 --> 27:57.130
Hershey.

530
27:57.130 --> 27:58.570
Thursday seven times.

531
27:59.170 --> 28:01.000
But I don't want this write.

532
28:01.000 --> 28:04.090
I don't want this at first iteration.

533
28:04.090 --> 28:08.680
I want, I want at first iteration I want.

534
28:11.050 --> 28:12.430
I want h.

535
28:14.800 --> 28:18.760
At first iteration I want H.

536
28:19.120 --> 28:23.890
Second iteration I want a third time I want r.

537
28:24.790 --> 28:31.520
Fourth time I want s So now for that purpose I can print like this, right?

538
28:31.520 --> 28:33.050
I can print like this.

539
28:33.500 --> 28:36.230
I have to use substring function.

540
28:37.010 --> 28:40.640
I have to use substring function in the substring function.

541
28:43.340 --> 28:44.240
What is.

542
28:44.270 --> 28:50.120
What is the string I want to search in which string I want to search right?

543
28:51.680 --> 28:54.290
What will substring will retrieve?

544
28:54.320 --> 28:57.740
See if I mention like this.

545
28:58.460 --> 28:59.630
Substring.

546
29:02.540 --> 29:05.240
Substring of first comma one.

547
29:05.240 --> 29:06.230
Comma one.

548
29:15.680 --> 29:19.820
So see over here H is printed right H is printed.

549
29:22.520 --> 29:26.450
Now I want to print a.

550
29:27.020 --> 29:29.030
Now I want to print a.

551
29:29.180 --> 29:31.610
So now what change I have to do over here.

552
29:31.610 --> 29:32.780
I have to do over here.

553
29:32.780 --> 29:35.330
Two two comma one.

554
29:35.330 --> 29:37.850
So it will give me one character.

555
29:37.850 --> 29:39.950
Starting position will be two.

556
29:40.550 --> 29:42.320
Now see what it will give me.

557
29:42.350 --> 29:43.520
It will give me a.

558
29:45.980 --> 29:50.450
Now again see three comma one.

559
29:50.480 --> 29:52.100
It will give me r.

560
29:55.160 --> 29:56.540
It will give me r.

561
29:58.430 --> 29:59.870
So every time.

562
29:59.870 --> 30:03.080
What value is in incrementing over here.

563
30:03.110 --> 30:04.490
See the pattern.

564
30:04.730 --> 30:06.200
Understand the pattern.

565
30:06.200 --> 30:09.620
What value is incrementing over here.

566
30:09.650 --> 30:13.520
The incrementing value over here is a starting position.

567
30:15.110 --> 30:18.230
So this one is my starting position

568
30:30.210 --> 30:31.650
And this one is.

569
30:35.460 --> 30:37.470
Number of characters from.

570
30:43.050 --> 30:45.990
Number of characters from the starting position.

571
30:48.300 --> 30:51.780
So every time this value is going to be increased, right.

572
30:54.570 --> 30:57.240
Every time this value is going to be increased.

573
30:57.270 --> 30:57.930
Right.

574
30:58.470 --> 31:05.730
So for that purpose you have to simple thing right.

575
31:05.730 --> 31:08.400
You have to print over here at the red x.

576
31:10.260 --> 31:13.590
So at first iteration it will become one.

577
31:13.650 --> 31:19.770
Now at x equal to wave to increase at that rate x equal to x plus one every time.

578
31:20.220 --> 31:23.830
So see when I execute this query when I execute this query.

579
31:23.860 --> 31:24.520
What will happen?

580
31:24.550 --> 31:28.630
C h a r s h I t.

581
31:33.520 --> 31:34.540
H a r.

582
31:37.090 --> 31:37.900
S h I t.

583
31:37.930 --> 31:38.530
Right.

584
31:41.260 --> 31:43.990
So at first iteration, what will happen?

585
31:44.380 --> 31:46.090
This value is one.

586
31:46.330 --> 31:48.490
Now at the rate x.

587
31:48.490 --> 31:49.900
So what is address x.

588
31:49.930 --> 31:53.440
One one less than equal to seven.

589
31:53.470 --> 31:53.950
True.

590
31:53.950 --> 31:55.900
Right one less than one.

591
31:55.900 --> 31:56.680
Less than.

592
31:56.680 --> 31:57.520
Equal to seven.

593
31:57.520 --> 31:58.180
True.

594
31:58.810 --> 32:02.950
Now it will begin substring harshit.

595
32:03.070 --> 32:05.350
Over here also it will become one.

596
32:05.440 --> 32:07.120
So one comma one.

597
32:07.120 --> 32:08.800
It will print h.

598
32:10.420 --> 32:14.860
Now it will increment the value of one equal to one plus 122.

599
32:14.890 --> 32:15.520
Right.

600
32:16.660 --> 32:22.360
So two less than equal to seven two less than equal to seven.

601
32:22.360 --> 32:23.680
True, true.

602
32:25.210 --> 32:28.390
So now it will in the headset it will start from where?

603
32:28.420 --> 32:29.710
It will start from two.

604
32:29.740 --> 32:30.760
Two comma one.

605
32:30.790 --> 32:32.950
See what it will print a.

606
32:36.730 --> 32:37.600
Ha.

607
32:38.830 --> 32:42.040
Now when it will become hit seven.

608
32:45.100 --> 32:49.780
Then it will increment seven plus 188 less than equal to seven.

609
32:49.780 --> 32:50.410
False.

610
32:50.410 --> 32:51.940
It will exit the loop right.

611
32:51.970 --> 32:53.320
It will exit the loop.

612
32:59.620 --> 33:00.940
It will exit the loop.

613
33:00.970 --> 33:03.340
You can speak if you have any doubt.

614
33:08.500 --> 33:10.150
This is a real programming.

615
33:10.150 --> 33:10.660
We can say.

616
33:10.660 --> 33:11.290
Right.

617
33:13.090 --> 33:14.440
This is perfectly clear.

618
33:15.700 --> 33:19.060
Okay, now let's move ahead

619
33:25.220 --> 33:29.810
Now let me see what is going to be printed over here.

620
33:29.840 --> 33:32.780
H e r s h I t.

621
33:32.810 --> 33:33.470
Okay.

622
33:34.100 --> 33:34.490
Okay.

623
33:34.490 --> 33:38.480
Now I ask you one question.

624
33:40.370 --> 33:46.580
Yes, I should if I want to print a, uh, one blank.

625
33:47.600 --> 33:47.810
Okay.

626
33:47.840 --> 33:49.220
Yeah, it is working.

627
33:49.280 --> 33:51.440
So now let's move ahead.

628
33:57.050 --> 34:01.220
This is the same example, but I have used something else over here.

629
34:01.490 --> 34:03.260
I have used the left keyword.

630
34:03.260 --> 34:05.720
It is also printing the ha s h I t.

631
34:07.700 --> 34:09.920
You can see it.

632
34:09.950 --> 34:12.200
Now let's move forward.

633
34:14.660 --> 34:17.840
Now see what is going to be happen over here.

634
34:17.870 --> 34:23.120
Write a program to input a string and print the following pattern.

635
34:23.150 --> 34:25.820
Now see what is going to be printed over here.

636
34:26.540 --> 34:30.050
Ha ha ha ha!

637
34:30.080 --> 34:30.620
SH!

638
34:31.370 --> 34:32.150
Like this.

639
34:32.180 --> 34:33.320
We want to print.

640
34:36.260 --> 34:37.100
Like this.

641
34:37.130 --> 34:37.940
We want to print.

642
34:37.940 --> 34:42.080
So what is the only change we have to do done in our above query?

643
34:42.290 --> 34:43.760
See over here.

644
34:44.150 --> 34:46.340
This time our starting position.

645
34:46.370 --> 34:48.290
Starting position will be.

646
34:48.290 --> 34:50.210
This is our previous query, right?

647
34:51.200 --> 34:52.850
This is our previous query.

648
34:55.160 --> 34:57.740
And this is our current query.

649
34:57.830 --> 35:02.540
Now see over here starting position is changing every time right.

650
35:02.570 --> 35:09.200
First time we want to start it from a sorry h then a then r then s.

651
35:09.200 --> 35:11.180
But over here what will happen.

652
35:12.590 --> 35:15.170
Our starting position will be static.

653
35:15.590 --> 35:16.730
See over here.

654
35:16.760 --> 35:19.290
Every time it is going to start with H.

655
35:20.160 --> 35:22.950
Every time we are going to start with H.

656
35:23.070 --> 35:24.780
But first attempt we are.

657
35:24.810 --> 35:26.670
We want one character.

658
35:26.700 --> 35:29.310
Second attempt we want two characters.

659
35:29.340 --> 35:30.030
Third attempt.

660
35:30.030 --> 35:32.070
We want three characters.

661
35:32.190 --> 35:33.210
Fourth attempt.

662
35:33.210 --> 35:34.680
We want four characters.

663
35:34.770 --> 35:41.520
So now over here in this particular query, see what is going to be happen over here.

664
35:41.550 --> 35:42.180
See?

665
35:42.210 --> 35:42.660
Ha!

666
35:42.720 --> 35:43.290
--.

667
35:44.100 --> 35:44.520
Right.

668
35:44.550 --> 35:46.200
Let me remove this one.

669
35:48.990 --> 35:49.440
Ha!

670
35:49.500 --> 35:50.040
--!

671
35:50.070 --> 35:52.710
You have to play.

672
35:52.740 --> 35:54.030
We have to play with.

673
35:54.030 --> 35:54.750
So over here.

674
35:54.750 --> 35:56.460
What is the change we want to do?

675
35:56.490 --> 35:59.490
Just starting is one.

676
35:59.490 --> 36:03.150
But at the rate X is going to be changed every time, right?

677
36:04.410 --> 36:06.690
Edit X is going to be changed every time.

678
36:06.720 --> 36:07.320
See?

679
36:09.780 --> 36:10.680
Simple.

680
36:10.680 --> 36:12.000
Only one change.

681
36:14.400 --> 36:15.960
Only one change we have done.

682
36:15.960 --> 36:19.000
And entire Best thing is working.

683
36:19.030 --> 36:21.010
Ha ha.

684
36:21.850 --> 36:26.050
But the main thing you should be aware about the substring function.

685
36:26.050 --> 36:28.450
You should be aware about the length function.

686
36:28.660 --> 36:32.530
If you are not aware about the substring function, then you cannot.

687
36:32.560 --> 36:35.950
You will be stuck, right?

688
36:35.950 --> 36:37.120
You will be stuck.

689
36:39.670 --> 36:43.150
While executing this kind of program.

690
36:45.910 --> 36:49.510
Now what is going to be happen over here?

691
36:51.820 --> 36:52.030
Okay.

692
36:52.030 --> 36:52.930
This is same thing.

693
36:52.960 --> 36:54.280
Ha h I t.

694
37:02.200 --> 37:05.740
Now see what I have done over here.

695
37:07.750 --> 37:10.150
Print harshit in reverse order.

696
37:10.240 --> 37:12.130
One character per line.

697
37:12.190 --> 37:13.810
Means t first.

698
37:13.840 --> 37:14.410
Right?

699
37:14.440 --> 37:16.180
So it is totally reverse, right?

700
37:16.210 --> 37:21.010
T h something like this.

701
37:22.600 --> 37:24.550
Now how?

702
37:25.840 --> 37:28.120
Let me first execute this query.

703
37:28.150 --> 37:28.840
See?

704
37:28.870 --> 37:30.640
Everything is in reverse order.

705
37:31.120 --> 37:34.210
T I h s r a h.

706
37:34.870 --> 37:38.260
Now, see, you have to understand starting with one, right?

707
37:38.650 --> 37:40.450
So one less than equal to seven.

708
37:40.450 --> 37:41.200
True.

709
37:41.470 --> 37:42.460
Now what?

710
37:42.460 --> 37:47.290
It will print substring right of Herseth.

711
37:48.790 --> 37:49.390
Over here.

712
37:49.390 --> 37:51.220
This one will become one.

713
37:51.220 --> 37:51.850
Right?

714
37:52.630 --> 37:54.970
This will become one now.

715
37:54.970 --> 37:56.170
Right of Herseth.

716
37:56.350 --> 37:57.940
So what is the right function?

717
37:57.940 --> 37:59.890
You have to understand this, right?

718
38:01.060 --> 38:01.870
Right.

719
38:01.900 --> 38:03.700
See over here, let me execute.

720
38:03.730 --> 38:04.660
Select.

721
38:07.780 --> 38:08.950
Right.

722
38:10.150 --> 38:10.990
Harshit.

723
38:11.230 --> 38:13.180
So it requires two parameter.

724
38:13.180 --> 38:14.260
Let me try.

725
38:15.010 --> 38:17.840
It is going to be some give some error.

726
38:17.960 --> 38:23.840
Now comma one see it is returning me t right.

727
38:23.840 --> 38:31.700
It is returning me t first time it is returning me t second time I want I.

728
38:33.500 --> 38:37.310
So so t t is returning.

729
38:37.340 --> 38:39.800
Now what is the starting position?

730
38:39.800 --> 38:41.360
Starting position one.

731
38:41.420 --> 38:43.220
We want one character, right?

732
38:43.250 --> 38:44.630
We want one character.

733
38:44.630 --> 38:50.360
So it will return me t only now if I mention over here two.

734
38:50.720 --> 38:55.610
So what it will return I t I t it is returning.

735
38:55.610 --> 38:56.240
Right.

736
38:57.500 --> 39:02.030
But now every time I want, I want first character.

737
39:02.060 --> 39:04.010
See, I want first character.

738
39:04.040 --> 39:08.270
Now if I mention three, what will happen again?

739
39:08.270 --> 39:10.430
It will become hit.

740
39:10.460 --> 39:21.180
But I want only h So for that purpose, one comma one I have mentioned in substring, it will start

741
39:21.180 --> 39:21.840
from one.

742
39:21.870 --> 39:28.080
It will start from one every time in this substring, and it will return me only one one character.

743
39:29.550 --> 39:32.040
It will return me only one character.

744
39:35.760 --> 39:39.210
So that is why this is a right function.

745
39:39.210 --> 39:42.390
Also we have to use as well as substring.

746
39:42.390 --> 39:49.320
Also we have to use right and we are incrementing this this value right function value.

747
39:51.870 --> 39:54.750
And right is not going to be give again.

748
39:54.750 --> 39:55.980
It will give me four.

749
39:56.430 --> 39:58.320
So it will give me --.

750
39:58.710 --> 40:04.830
But I want only s I want only s.

751
40:05.550 --> 40:07.680
See over here I want only s.

752
40:07.800 --> 40:13.770
So that is why I have done substring and this is everything else will be same right?

753
40:14.340 --> 40:16.500
At the rate x equal to x plus one.

754
40:16.500 --> 40:18.150
That is going to be same.

755
40:21.720 --> 40:22.680
Right.

756
40:25.710 --> 40:28.440
Now over here this is also simple thing.

757
40:28.530 --> 40:30.690
We have to just use the right.

758
40:31.500 --> 40:33.210
Firstly it will give me t.

759
40:34.140 --> 40:35.400
We have seen this right.

760
40:35.430 --> 40:36.600
We have seen this over here.

761
40:36.630 --> 40:38.760
First iteration it will give me t.

762
40:39.180 --> 40:41.400
Second iteration it will give me it.

763
40:42.240 --> 40:43.140
Third iteration.

764
40:43.140 --> 40:45.360
So over here everything I have removed.

765
40:45.660 --> 40:48.720
And this is the pattern t I t h I t.

766
40:51.450 --> 40:52.650
Like this.

767
40:52.890 --> 40:54.270
Now let us see one.

768
40:54.300 --> 40:54.570
Yeah.

769
40:54.600 --> 40:57.000
This is one important example.

770
40:57.270 --> 40:59.880
First iteration we want to print star.

771
40:59.910 --> 41:03.390
Then second iteration we want to print double asterisk.

772
41:03.990 --> 41:06.540
Third iteration we want to print three asterisk.

773
41:06.570 --> 41:11.310
So to replicate the same thing see over here.

774
41:11.340 --> 41:12.730
See Select.

775
41:13.840 --> 41:15.310
Replicate.

776
41:17.380 --> 41:21.160
Ten star ten comma five.

777
41:21.190 --> 41:22.870
See what will happen.

778
41:25.390 --> 41:29.620
It is going to be replicate specific string five times.

779
41:31.180 --> 41:35.020
If I mention four it will give me star four times.

780
41:38.320 --> 41:44.260
If I specify three it will give me star three times.

781
41:48.040 --> 41:48.760
Right.

782
41:48.760 --> 41:51.040
That what I want to want.

783
41:51.070 --> 41:54.040
So over here you want to change this one, right?

784
41:54.040 --> 41:56.860
You want to change this one in every iteration?

785
41:57.100 --> 41:58.120
First time.

786
41:58.120 --> 41:59.770
One second time two.

787
41:59.980 --> 42:01.180
Third time three.

788
42:01.240 --> 42:05.530
So that is the thing what we have done over here it is replicate.

789
42:05.800 --> 42:08.110
Iterate X will be changing every time.

790
42:08.110 --> 42:10.000
It is incrementing every time.

791
42:10.090 --> 42:14.020
And it is going to be exit when six will come.

792
42:14.020 --> 42:16.270
So six less than equal to five false.

793
42:16.270 --> 42:17.710
So it will exit.

794
42:18.760 --> 42:20.920
So first time it will print one star.

795
42:20.950 --> 42:23.200
Second time it will print two star.

796
42:23.320 --> 42:26.980
Third time it will print three star like the same right.

797
42:30.850 --> 42:31.090
Okay.

798
42:31.090 --> 42:32.950
This is in reverse order.

799
42:35.320 --> 42:35.620
Okay.

800
42:35.650 --> 42:37.690
This I have done in reverse order.

801
42:37.690 --> 42:41.080
So over here iteration I am starting with five.

802
42:41.260 --> 42:45.610
So first time it will five star will be printed.

803
42:46.060 --> 42:49.720
Now over here I have done x minus one.

804
42:49.810 --> 42:52.390
So it will become five minus one four.

805
42:52.390 --> 42:55.390
So second time it will return me four star.

806
42:55.660 --> 42:58.030
Third time it will return me three star.

807
43:00.160 --> 43:03.970
So this is what you can play by yourself as well right?

808
43:08.440 --> 43:10.660
Now you can let me know if you have any.