1
00:00:00,590 --> 00:00:04,170
OK, so let us discuss the last problem of part two.

2
00:00:04,820 --> 00:00:06,170
So problem Lamberti.

3
00:00:09,350 --> 00:00:16,280
The problem statement is read in and print full length by 10.

4
00:00:20,020 --> 00:00:21,850
Brent following pattern.

5
00:00:23,770 --> 00:00:28,140
If the really of and is three, the pattern will look like this.

6
00:00:32,640 --> 00:00:37,200
If the value of and is too bad, then will look like this.

7
00:00:39,060 --> 00:00:44,520
And if the value of N is five, the better would look something like this.

8
00:00:59,870 --> 00:01:02,360
OK, so how we can solve this problem?

9
00:01:06,050 --> 00:01:08,210
If you look carefully, if the value of.

10
00:01:08,770 --> 00:01:09,150
T.

11
00:01:09,620 --> 00:01:11,050
I am printing three.

12
00:01:12,390 --> 00:01:15,880
If the value of Venice to I am printing doodles.

13
00:01:16,370 --> 00:01:20,380
If the value of wine is five, I am printing faithful's.

14
00:01:21,380 --> 00:01:28,490
So one thing is very clear here that I need a loop and this loop will run and times.

15
00:01:30,510 --> 00:01:33,560
Because we have to print Enda's is the value of.

16
00:01:33,750 --> 00:01:34,400
Is three.

17
00:01:34,680 --> 00:01:36,360
This look Willdan two times.

18
00:01:36,440 --> 00:01:39,820
If the value of N is to this look vildan two times.

19
00:01:39,870 --> 00:01:44,130
And if the value of an is five this look Willdan five times.

20
00:01:45,390 --> 00:01:46,850
OK, so let us revise.

21
00:01:47,210 --> 00:01:52,860
So the problem was I have to read and and we have to print following patterns over the value of ancestry.

22
00:01:53,390 --> 00:01:54,380
I have to print materials.

23
00:01:54,620 --> 00:01:56,500
If the value of I need to I have to print to.

24
00:01:56,740 --> 00:01:59,130
If the value of finance life, I have to print five rolls.

25
00:01:59,660 --> 00:02:02,230
So I told you that I need a loop.

26
00:02:02,660 --> 00:02:06,050
And this look, Willdan end times because we have to print.

27
00:02:06,170 --> 00:02:06,650
And those.

28
00:02:07,900 --> 00:02:08,080
OK.

29
00:02:08,190 --> 00:02:11,070
So how will this loop run and times?

30
00:02:11,400 --> 00:02:18,480
So I will use a variable eye which is initialized to one is I less than Noriko's two n.

31
00:02:20,450 --> 00:02:22,340
And I equals a plus one.

32
00:02:23,120 --> 00:02:28,220
So with the help of these three blogs, this loop will run end times.

33
00:02:29,520 --> 00:02:29,810
OK.

34
00:02:30,620 --> 00:02:31,940
And inside this loop.

35
00:02:32,420 --> 00:02:33,050
Each time.

36
00:02:33,350 --> 00:02:34,010
What will I do?

37
00:02:34,100 --> 00:02:35,000
I will print all.

38
00:02:37,300 --> 00:02:42,200
I'm putting myself each time this loop is running, I will print Arrow.

39
00:02:44,230 --> 00:02:44,480
OK.

40
00:02:45,240 --> 00:02:52,080
This loop is running and times, and each time I am printing, I do so in total I will be able to print

41
00:02:52,280 --> 00:02:52,780
Ando's.

42
00:02:53,370 --> 00:02:54,750
So the approach is very simple.

43
00:02:55,080 --> 00:02:58,570
This loop is ending and times and each time I am printing Adderall.

44
00:02:59,010 --> 00:03:01,470
So finally I will be able to print and lose.

45
00:03:02,640 --> 00:03:05,890
Now, the second problem, how to print a rule.

46
00:03:08,220 --> 00:03:09,360
How will I bring that to.

47
00:03:15,110 --> 00:03:20,380
So if you look carefully each time, I have to print different oral.

48
00:03:22,590 --> 00:03:27,820
Here, the value of I is three here, the value of AI is to value of to vilify one.

49
00:03:28,140 --> 00:03:34,470
So if the value if I is when I have to print just one star is the value of AI is do I have to print

50
00:03:34,760 --> 00:03:35,390
those stars.

51
00:03:35,490 --> 00:03:38,660
If the value of AI is three, I have to print two stars.

52
00:03:39,090 --> 00:03:45,030
You can look here, also here I equals four here and I equals five and so on.

53
00:03:45,630 --> 00:03:46,710
Here I equals one.

54
00:03:46,980 --> 00:03:50,200
So if the value of AI is one, I have to print just one star.

55
00:03:50,250 --> 00:03:54,720
If the value of I used to I have to print two stars and if the value of AI is five, I have to print

56
00:03:54,750 --> 00:03:55,380
five stars.

57
00:03:56,460 --> 00:04:06,330
So for printing a rule, I need a loop and this loop will run eight times because you can see here if

58
00:04:06,330 --> 00:04:07,570
the value of AI is three.

59
00:04:07,700 --> 00:04:09,090
I am printing three stars.

60
00:04:09,880 --> 00:04:12,570
If the value of AI is two, I am printing two stars.

61
00:04:13,530 --> 00:04:16,220
If the real fight is won, I am printing one stars.

62
00:04:16,650 --> 00:04:21,750
So that is the reason I need a lube and this loop will run eight times.

63
00:04:22,690 --> 00:04:24,900
OK, so how will I run this loop by eight times.

64
00:04:25,290 --> 00:04:28,900
I will use a variable G which is initialized to one.

65
00:04:28,920 --> 00:04:29,700
Then I will check.

66
00:04:29,850 --> 00:04:31,770
Is G less than or equal to a.

67
00:04:33,280 --> 00:04:34,060
And J.

68
00:04:34,100 --> 00:04:36,010
Equals J plus one.

69
00:04:37,120 --> 00:04:42,280
So with the help of these three blogs, this loop will run eight times.

70
00:04:43,240 --> 00:04:43,550
OK.

71
00:04:43,840 --> 00:04:44,800
So let us revise.

72
00:04:45,160 --> 00:04:47,860
So the question was, I have to print oral.

73
00:04:48,190 --> 00:04:49,370
So how do I bring Durrow?

74
00:04:49,960 --> 00:04:53,860
So I told you, if you look carefully, if the value of history I am printing through Rose.

75
00:04:53,950 --> 00:04:56,080
If the value if I is true, I am printing to Rose.

76
00:04:56,110 --> 00:04:56,560
If the value.

77
00:04:56,560 --> 00:04:58,400
If I is when I am printing Wendle.

78
00:04:59,650 --> 00:05:00,930
So I need a loop.

79
00:05:02,200 --> 00:05:06,690
And this loop will run eight times, and each time I will print.

80
00:05:07,380 --> 00:05:08,490
I start OK.

81
00:05:08,920 --> 00:05:11,170
So each time I am printing, I start.

82
00:05:11,230 --> 00:05:13,060
And this loop is running eight times.

83
00:05:13,150 --> 00:05:16,240
So in total, I will be able to print I starts.

84
00:05:17,570 --> 00:05:23,660
I am repeating myself, each time this loop is running, I will print star and this loop is running

85
00:05:23,800 --> 00:05:26,940
eight times, so I will be able to print I starts.

86
00:05:28,010 --> 00:05:32,530
And how will I run this loop by at times with the help of these three blogs.

87
00:05:33,110 --> 00:05:35,690
I will be able to run this loop eight times.

88
00:05:36,680 --> 00:05:37,990
So let does the the flowchart.

89
00:05:43,450 --> 00:05:45,130
So I will start my flow chart.

90
00:05:49,420 --> 00:05:50,860
Then I will read an.

91
00:05:54,810 --> 00:06:00,090
And then I have to print Ando's, so I will use a variable play, which is initialized to one.

92
00:06:00,450 --> 00:06:03,770
Then I will check the condition is I.

93
00:06:04,200 --> 00:06:05,790
Less than articles to end.

94
00:06:08,670 --> 00:06:10,520
Now, if this condition is true.

95
00:06:13,040 --> 00:06:18,270
If this condition is true, that means I'm inside this loop and inside this loop.

96
00:06:18,410 --> 00:06:24,740
Each time I have to print a rule and we have discussed that for printing a rule, I need a loop.

97
00:06:25,040 --> 00:06:27,560
And this loop will run eight times.

98
00:06:30,200 --> 00:06:30,470
OK.

99
00:06:31,360 --> 00:06:36,970
So for running the loop, I at times I am using a variable G which is initialized to one, then I will

100
00:06:36,970 --> 00:06:41,380
check is g less than or it goes to a.

101
00:06:42,780 --> 00:06:47,430
Now, if this condition is true, I have to print stutt.

102
00:06:51,250 --> 00:06:52,870
Jay, it goes deep, less than.

103
00:06:54,980 --> 00:06:57,230
And then check the condition again.

104
00:07:00,980 --> 00:07:01,280
OK.

105
00:07:01,340 --> 00:07:05,750
So this loop is running eight times and each time I am printing, I start.

106
00:07:06,380 --> 00:07:08,900
So in total, this loop will print.

107
00:07:09,290 --> 00:07:10,490
I starts.

108
00:07:11,760 --> 00:07:13,830
And if this condition is false.

109
00:07:15,910 --> 00:07:20,740
So if this condition is false, that means I have printed Windrow.

110
00:07:24,970 --> 00:07:27,450
Now I have to go to next to line.

111
00:07:28,240 --> 00:07:29,890
So Brent backslash.

112
00:07:29,960 --> 00:07:33,600
And so this is a command for going to next line.

113
00:07:34,480 --> 00:07:37,030
And then I will increase the value of fire by one.

114
00:07:38,440 --> 00:07:40,330
And then I will check the condition again.

115
00:07:42,660 --> 00:07:44,400
So why I'm writing this statement.

116
00:07:46,200 --> 00:07:51,150
If you look carefully after printing this rule, I have to go to next line.

117
00:07:51,510 --> 00:07:54,180
Similarly, after printing this rule, go to next plane.

118
00:07:54,240 --> 00:07:56,730
After printing this rule, I have to go to next line.

119
00:07:58,530 --> 00:08:01,770
So this loop is printing VENDEL.

120
00:08:02,010 --> 00:08:05,330
And after printing this rule, I have to go to next line.

121
00:08:05,430 --> 00:08:07,470
That's why I'm using this statement.

122
00:08:08,370 --> 00:08:09,680
And then I will say, listen.

123
00:08:09,810 --> 00:08:11,520
And then I will check the condition again.

124
00:08:12,390 --> 00:08:17,880
So this loop is running eight times and each time I am printing, I start.

125
00:08:18,570 --> 00:08:27,900
So in total, I will be able to print ice stars and my outlook is running and times and each time I

126
00:08:27,900 --> 00:08:28,440
am printing.

127
00:08:29,040 --> 00:08:33,930
So I will be able to print Ando's if this condition is false.

128
00:08:35,040 --> 00:08:40,080
That means I have rendered all my end those and my work is over now.

129
00:08:40,170 --> 00:08:42,270
So I will end my program.

130
00:08:44,150 --> 00:08:47,450
OK, so let us understand this flowchart with the help of an example.

131
00:08:51,610 --> 00:09:05,770
OK, so let's say the value of an is three start root and I equals one, so I equals one is one less

132
00:09:05,770 --> 00:09:06,580
than I goes to three.

133
00:09:06,640 --> 00:09:07,780
So the condition is true.

134
00:09:08,380 --> 00:09:09,160
You will come here.

135
00:09:09,610 --> 00:09:10,480
J equals one.

136
00:09:10,870 --> 00:09:11,200
Okay.

137
00:09:11,410 --> 00:09:12,620
J equals one.

138
00:09:14,630 --> 00:09:19,280
Then he will check the condition is one less than Ocus to into the condition is true.

139
00:09:19,340 --> 00:09:21,250
You will start August.

140
00:09:21,310 --> 00:09:22,610
I am writing my output here.

141
00:09:23,880 --> 00:09:27,470
So I am printing start increase the value of G.

142
00:09:27,530 --> 00:09:29,810
By one to the new value of J is two.

143
00:09:31,550 --> 00:09:33,770
And then you have to check the condition again.

144
00:09:34,580 --> 00:09:35,670
So is to list.

145
00:09:35,670 --> 00:09:37,840
Then I goes to one to the condition is false.

146
00:09:39,420 --> 00:09:47,770
Windrow has been printed and you have to go to next plane, so I will come here next plane and you are

147
00:09:47,770 --> 00:09:50,860
doing is the value if I buy one or the new value if I is to.

148
00:09:54,520 --> 00:10:00,160
And then you will check the condition again is to list an order close to three.

149
00:10:00,250 --> 00:10:01,390
So the condition is true.

150
00:10:01,510 --> 00:10:04,180
You will come here J equals one.

151
00:10:04,290 --> 00:10:04,630
OK.

152
00:10:06,920 --> 00:10:11,840
Check the condition again is when Lester goes to do to the condition is true.

153
00:10:11,900 --> 00:10:12,650
You will come here.

154
00:10:13,390 --> 00:10:14,550
Brent, start okay.

155
00:10:17,150 --> 00:10:20,300
Engage the value of the observance or the new value of JS to.

156
00:10:21,910 --> 00:10:25,220
The condition, again, is to let them I what to do.

157
00:10:25,360 --> 00:10:26,320
The condition is true.

158
00:10:27,170 --> 00:10:27,910
Brent Astar.

159
00:10:28,180 --> 00:10:28,510
Okay.

160
00:10:30,580 --> 00:10:35,920
And give them a little gem Evans, when you live J.s three and then you have to check the condition

161
00:10:35,920 --> 00:10:36,220
again.

162
00:10:36,550 --> 00:10:38,440
So is three less than goes to do?

163
00:10:38,790 --> 00:10:38,970
No.

164
00:10:39,250 --> 00:10:40,300
The condition is void.

165
00:10:42,030 --> 00:10:42,750
What will you do?

166
00:10:42,840 --> 00:10:44,670
You will go to New Line.

167
00:10:44,760 --> 00:10:45,000
OK.

168
00:10:45,120 --> 00:10:46,110
Now I will come here.

169
00:10:47,850 --> 00:10:48,640
Now what will you do?

170
00:10:48,660 --> 00:10:51,840
You will increase the value if I buy one to the new value of AI is three.

171
00:10:52,650 --> 00:10:54,570
So I equals three.

172
00:10:55,050 --> 00:10:57,000
And then you will check the condition again.

173
00:10:57,420 --> 00:10:59,640
So is three less than ogles to treat?

174
00:10:59,700 --> 00:11:00,570
The condition is true.

175
00:11:00,630 --> 00:11:02,180
You will come here J.

176
00:11:02,220 --> 00:11:02,730
Question.

177
00:11:02,790 --> 00:11:03,100
Okay.

178
00:11:03,360 --> 00:11:05,130
J equals when.

179
00:11:06,570 --> 00:11:10,180
Then I will check is one less than I goes to three.

180
00:11:10,450 --> 00:11:11,680
Yes, the condition is true.

181
00:11:11,740 --> 00:11:17,230
You will print Stata and gives the year by events when new value of JS to.

182
00:11:19,130 --> 00:11:21,290
And then you have to check the condition again.

183
00:11:21,680 --> 00:11:24,010
So is to list then articles close three.

184
00:11:24,860 --> 00:11:25,050
Yes.

185
00:11:25,090 --> 00:11:25,970
The condition is true.

186
00:11:26,060 --> 00:11:29,810
You will start again and give them a live J by one.

187
00:11:30,290 --> 00:11:31,840
So I live j.s three.

188
00:11:32,320 --> 00:11:33,710
I will check the condition again.

189
00:11:34,070 --> 00:11:37,790
So is t less than Noriko's to treat the condition is again through.

190
00:11:38,080 --> 00:11:39,380
You will print one more stop.

191
00:11:40,540 --> 00:11:42,230
Now will you increase their LFG by one.

192
00:11:42,260 --> 00:11:43,130
So anyway, live J.

193
00:11:43,520 --> 00:11:44,540
J will become four.

194
00:11:44,960 --> 00:11:47,750
So is for less than was two three.

195
00:11:48,140 --> 00:11:49,570
No, the condition is false.

196
00:11:49,580 --> 00:11:52,730
So if the condition is false you will go to new line.

197
00:11:53,390 --> 00:11:53,720
Okay.

198
00:11:54,830 --> 00:11:57,180
Next line and you will increase the value of five.

199
00:11:57,510 --> 00:11:59,880
So the new value of EI is four.

200
00:12:01,190 --> 00:12:03,460
And then you will check the condition again.

201
00:12:03,860 --> 00:12:07,070
So is for less than or equal to three.

202
00:12:07,370 --> 00:12:07,730
No.

203
00:12:08,450 --> 00:12:10,690
Four is not less than a cost to three.

204
00:12:11,150 --> 00:12:12,360
So the condition is void.

205
00:12:13,370 --> 00:12:15,620
You will reach here and you will end up program.

206
00:12:15,980 --> 00:12:17,210
So my output is this.

207
00:12:19,350 --> 00:12:21,890
Which is hundred percent correct for any quiz.

208
00:12:22,410 --> 00:12:22,710
Three.

209
00:12:23,850 --> 00:12:25,320
So let us revise what we have done.

210
00:12:27,580 --> 00:12:32,480
So the problem statement was, I have to read and and we have to print the following button.

211
00:12:32,980 --> 00:12:36,760
So if any equals to I am printing doodles if N equals five.

212
00:12:36,820 --> 00:12:38,050
I am printing five floors.

213
00:12:38,140 --> 00:12:41,120
And if and equals three, I am printing Titos.

214
00:12:42,460 --> 00:12:49,660
So one thing is crystal clear here that I need a loop that will run end times because we have to print

215
00:12:49,910 --> 00:12:51,870
those is the value of ministry.

216
00:12:51,970 --> 00:12:57,060
This love will end two times if the value of this to this loop will burn two times if the value of Venezuela.

217
00:12:57,100 --> 00:13:02,580
This look within five times and inside this loop I have to print double.

218
00:13:04,910 --> 00:13:09,710
So each time I am branding arrow and outer loop is running end times.

219
00:13:10,010 --> 00:13:12,560
So in total I will be able to print and lose.

220
00:13:13,420 --> 00:13:15,380
So the first part of this problem is over.

221
00:13:15,800 --> 00:13:16,610
Now the second part.

222
00:13:18,220 --> 00:13:20,060
How to print a room?

223
00:13:20,930 --> 00:13:21,820
Then I told you.

224
00:13:21,880 --> 00:13:24,580
If we look carefully here, if I is three.

225
00:13:24,640 --> 00:13:29,300
So if the value of history I'm printing three stars, if the value of AI is two and printing to start.

226
00:13:29,410 --> 00:13:32,580
If the value of AI is when I am printing just one star.

227
00:13:33,460 --> 00:13:37,990
That means I need a loop and this loop will run eight times.

228
00:13:38,050 --> 00:13:41,310
And inside this loop each time I will print star.

229
00:13:41,950 --> 00:13:45,970
So each time I am printing a star and the outer loop is running eight times.

230
00:13:46,060 --> 00:13:49,200
So in total I would be able to print isobars.

231
00:13:50,230 --> 00:13:55,480
And how will I run this loop by four times with the help of these three blogs, I will be able to run

232
00:13:55,480 --> 00:13:56,590
this loop eight times.

233
00:13:57,100 --> 00:14:00,400
And for running the loop end times, I will use a variable eye.

234
00:14:00,850 --> 00:14:04,060
And with the help of these three blogs, I will be able to run this loop.

235
00:14:04,120 --> 00:14:04,690
And times.

236
00:14:07,290 --> 00:14:09,650
And this is our very simple flu, Jack.

237
00:14:10,410 --> 00:14:13,150
So let's take another example to understand this flowchart.

238
00:14:13,830 --> 00:14:15,180
So let's say and it goes to.

239
00:14:16,590 --> 00:14:19,860
So you start read and I equals one.

240
00:14:20,670 --> 00:14:22,470
So I equals one.

241
00:14:23,630 --> 00:14:24,560
So is.

242
00:14:25,780 --> 00:14:29,290
One less than I got to do for the condition is true, you will come here.

243
00:14:30,100 --> 00:14:35,800
Then Jaquiss one against a Jaquiss one you will check the condition is one less than Agosta.

244
00:14:35,800 --> 00:14:37,800
When the condition is true, we will bring it to start.

245
00:14:38,060 --> 00:14:38,250
OK.

246
00:14:38,410 --> 00:14:42,490
So I am printing stuff and then you will increase the value of J by one.

247
00:14:42,730 --> 00:14:44,300
So the new value of J will become do.

248
00:14:45,130 --> 00:14:46,950
And then you will check the condition again.

249
00:14:47,470 --> 00:14:50,680
So is two less than articles two also the condition is false.

250
00:14:51,190 --> 00:14:56,830
I have printed when I'm Tyrel I have to go to a new line, so I will go to next line.

251
00:14:57,460 --> 00:14:59,100
So now you will increase the value of five.

252
00:14:59,110 --> 00:15:05,230
I want to show the new value of I is two and then I will check the condition again is to list Anglo's

253
00:15:05,230 --> 00:15:10,670
to two for the condition is true j.s again one then you will check the condition again.

254
00:15:11,290 --> 00:15:12,790
So is one less than I goes to.

255
00:15:12,790 --> 00:15:19,080
When the condition is true, you will again being tested and then you will increase the value of J by

256
00:15:19,080 --> 00:15:20,920
one to the new valy of J will become do.

257
00:15:20,920 --> 00:15:24,250
Then you will change the condition again and the condition will again be true.

258
00:15:24,610 --> 00:15:29,140
You will print against that and you will engage the role of thereby once when you will, you will become

259
00:15:29,140 --> 00:15:35,200
three and you have printed this entire drawer and then you will go to a new line.

260
00:15:35,950 --> 00:15:39,310
You will engage the earlier five events of the new value of I will become three.

261
00:15:40,390 --> 00:15:42,910
And similarly, this condition will become false.

262
00:15:43,240 --> 00:15:49,900
And then you will enter program and the output will be this, which is under percent correct for N equals

263
00:15:50,160 --> 00:15:50,340
two.

264
00:15:51,100 --> 00:15:56,950
So this problem requires use of two loops, one loop inside and the loop.

265
00:15:57,370 --> 00:16:02,760
So this inner loop is running eight times and each time I am printing, I start.

266
00:16:02,830 --> 00:16:06,210
So in total I am printing Istar Sarah.

267
00:16:08,710 --> 00:16:09,000
OK.

268
00:16:09,880 --> 00:16:11,250
And the outer loop.

269
00:16:12,600 --> 00:16:18,480
Is running and times and each time I am printing Vendel.

270
00:16:18,930 --> 00:16:21,810
So in total I will be able to print Androes.

271
00:16:23,480 --> 00:16:25,490
So I hope you have understood this problem.

272
00:16:25,670 --> 00:16:29,060
We will be printing many such patterns in our future lessons.

273
00:16:29,630 --> 00:16:32,120
So this problem should be crystal clear in your mind.

274
00:16:32,420 --> 00:16:36,560
That is why we need to lose here how this loops are working.

275
00:16:37,220 --> 00:16:43,550
So my advice to you is take out your pen and paper and try to do the flowchart on your own.

276
00:16:44,620 --> 00:16:48,790
Take few different values often and try to understand how this loops are working.

277
00:16:49,870 --> 00:16:53,500
So finally, congratulations on finishing all the six problems.

278
00:16:53,770 --> 00:16:55,090
You have done a great job.

279
00:16:55,930 --> 00:16:59,140
So if you have any doubt in any question, feel free to ask.

280
00:16:59,520 --> 00:17:01,490
In the next class, we will learn pseudocode.

281
00:17:03,430 --> 00:17:04,090
Pseudo.

282
00:17:05,940 --> 00:17:09,470
Called the next class will be focused on pseudocode.

283
00:17:09,780 --> 00:17:11,430
So I hope you enjoyed today's tutorial.

284
00:17:11,550 --> 00:17:12,840
I will tune an extra story.

285
00:17:13,030 --> 00:17:14,550
Till then, enjoy C++.
