1
00:00:01,200 --> 00:00:02,880
Hey, guys, what's up?

2
00:00:03,240 --> 00:00:08,280
So today we are going to solve one more interesting problem, one more PADDON printing problem.

3
00:00:09,030 --> 00:00:15,450
So the rebels treatment is given and we have to print the falling pattern.

4
00:00:16,530 --> 00:00:18,600
So given then we have to print.

5
00:00:20,520 --> 00:00:26,040
We have to rent a falling pattern, so for any equals five.

6
00:00:26,100 --> 00:00:27,960
My pattern will be something like.

7
00:00:50,050 --> 00:00:56,440
So if you remember, we have already sold this type of problem and flowcharts or I think in some locals.

8
00:00:57,400 --> 00:00:59,620
So the logic was very simple here.

9
00:00:59,710 --> 00:01:05,590
The Valley of Fire is one here, the valley of fire is to the valley of phase three.

10
00:01:06,100 --> 00:01:09,280
The valley of high is full and the valley VLDL, phase five.

11
00:01:09,700 --> 00:01:11,110
So one thing is very clear.

12
00:01:11,560 --> 00:01:14,970
If the veil of and it's five, I have to print five arrows.

13
00:01:15,430 --> 00:01:15,620
OK.

14
00:01:16,030 --> 00:01:19,740
So I need an outer loop and this loop will run and times.

15
00:01:20,740 --> 00:01:24,790
So and time's outer loop.

16
00:01:25,780 --> 00:01:28,540
And first of all, I have to print spaces.

17
00:01:28,930 --> 00:01:29,560
So how I mean, it's.

18
00:01:29,860 --> 00:01:30,610
I have to print.

19
00:01:31,540 --> 00:01:32,470
I have to print.

20
00:01:32,890 --> 00:01:35,260
And minus I space's.

21
00:01:37,240 --> 00:01:39,730
OK, then I have to print values.

22
00:01:40,770 --> 00:01:45,130
Then I have to print values and how many will lose?

23
00:01:45,330 --> 00:01:46,110
I have to print.

24
00:01:47,340 --> 00:01:51,780
So I have to print the way minus one values.

25
00:01:53,160 --> 00:01:54,000
I have to print.

26
00:01:54,150 --> 00:01:54,870
You can see here.

27
00:01:54,900 --> 00:01:56,360
I have to print to I minus.

28
00:01:56,520 --> 00:01:59,040
When we lose the value of I is three.

29
00:01:59,610 --> 00:02:00,920
So two and two.

30
00:02:00,930 --> 00:02:02,070
Three minus one.

31
00:02:02,100 --> 00:02:03,000
That is five.

32
00:02:03,150 --> 00:02:04,790
So I have to print five.

33
00:02:04,800 --> 00:02:05,170
Raila's.

34
00:02:06,570 --> 00:02:13,730
OK, so first I will print and minus ibises and then I will print Douai, minus one may lose starting.

35
00:02:15,410 --> 00:02:17,120
From one.

36
00:02:17,660 --> 00:02:20,950
So I have to bring it to a minus when we lose, starting from one.

37
00:02:22,280 --> 00:02:28,100
And then after printing the entire rule, what I will do, I have to will do next line.

38
00:02:28,130 --> 00:02:30,800
So she yelled and line.

39
00:02:30,900 --> 00:02:32,960
Now this go to next line.

40
00:02:33,500 --> 00:02:35,120
So this is our logic.

41
00:02:36,250 --> 00:02:36,500
OK.

42
00:02:37,130 --> 00:02:39,710
So let us implement and C++.

43
00:02:45,630 --> 00:02:49,490
So let us name this file as number by 10.

44
00:02:49,800 --> 00:02:50,550
So a number.

45
00:02:53,590 --> 00:02:54,070
Burton.

46
00:03:08,010 --> 00:03:18,180
So what I have to do, I will first take and as input fundi, use it then since we have to print Androes,

47
00:03:18,390 --> 00:03:22,760
I need a loop and this loop children and times.

48
00:03:22,860 --> 00:03:24,090
So in Dich was when.

49
00:03:27,900 --> 00:03:31,230
While I is less than or equal to n

50
00:03:33,960 --> 00:03:34,970
I blessed, blessed.

51
00:03:35,460 --> 00:03:41,220
So this loop will run and times and each time this loop is running.

52
00:03:41,280 --> 00:03:43,170
I have to print a year through.

53
00:03:44,150 --> 00:03:44,540
Okay.

54
00:03:44,910 --> 00:03:47,330
And for printing I year through.

55
00:03:47,670 --> 00:03:49,050
This is my logic.

56
00:03:49,740 --> 00:03:52,020
So this logic is for printing.

57
00:03:52,290 --> 00:03:53,240
Yet a rule.

58
00:03:54,060 --> 00:03:57,100
So first of all I have to print and minus I spaces.

59
00:03:57,630 --> 00:04:02,960
So I need a lube and this loop should run and minus one times.

60
00:04:03,630 --> 00:04:03,890
Okay.

61
00:04:04,500 --> 00:04:06,480
So let's do it.

62
00:04:07,590 --> 00:04:11,100
So I need a loop that will run and minus one times.

63
00:04:11,580 --> 00:04:16,150
So that us take a variable and count equals one.

64
00:04:17,160 --> 00:04:17,960
And how many times.

65
00:04:17,960 --> 00:04:20,460
And children and minus eight times.

66
00:04:20,550 --> 00:04:28,020
So while ground is less than articles two and minus I.

67
00:04:31,070 --> 00:04:36,320
So this loop is learning and minus times, and each time this loop is running.

68
00:04:36,410 --> 00:04:40,940
I have to print spaces, so I have to print spaces.

69
00:04:42,410 --> 00:04:44,480
So now I have printed special.

70
00:04:46,010 --> 00:04:51,130
What I have to do now, now I have to print values.

71
00:04:52,130 --> 00:04:55,970
I have to print values starting from one.

72
00:04:56,270 --> 00:04:57,920
So how many values I have to print?

73
00:04:58,100 --> 00:05:00,770
I have to print the way minus one may lose.

74
00:05:00,860 --> 00:05:08,450
That means I need a lube and this lube children to a minus one times.

75
00:05:10,210 --> 00:05:10,400
OK.

76
00:05:10,520 --> 00:05:13,190
So this look, children do y minus one times.

77
00:05:13,700 --> 00:05:15,750
And also I will need a variable.

78
00:05:16,130 --> 00:05:17,430
Let's call it value initially.

79
00:05:17,440 --> 00:05:18,520
Well it will be one.

80
00:05:18,800 --> 00:05:20,240
And value will be incremented.

81
00:05:20,780 --> 00:05:21,800
At each step.

82
00:05:23,260 --> 00:05:23,530
OK.

83
00:05:25,300 --> 00:05:27,130
Why my values initially when?

84
00:05:27,970 --> 00:05:30,220
Because you can see here.

85
00:05:30,690 --> 00:05:36,170
I have to start printing from one and then I really incremental I.

86
00:05:36,580 --> 00:05:38,710
Because then I have to print two.

87
00:05:38,800 --> 00:05:39,430
Then three.

88
00:05:40,210 --> 00:05:41,920
Then again, two and three and four.

89
00:05:41,920 --> 00:05:42,640
And then five.

90
00:05:43,030 --> 00:05:45,910
And how many values do I minus one values.

91
00:05:45,970 --> 00:05:47,030
So I need to do that.

92
00:05:47,030 --> 00:05:48,820
QUILLIAN do I minus one times.

93
00:05:50,020 --> 00:05:51,610
OK, cool.

94
00:05:52,750 --> 00:05:53,380
So.

95
00:05:55,750 --> 00:05:56,860
I need a loop.

96
00:05:57,430 --> 00:05:59,310
So let's call it J.

97
00:05:59,590 --> 00:06:01,600
So into J equals one.

98
00:06:02,530 --> 00:06:04,540
And I need a value.

99
00:06:05,040 --> 00:06:10,090
So initially value it equals one because I had to start printing from one.

100
00:06:10,900 --> 00:06:13,090
So how many times this loop should run?

101
00:06:13,810 --> 00:06:17,080
So this loop children the way minus one times.

102
00:06:17,770 --> 00:06:20,410
So the A minus one.

103
00:06:24,780 --> 00:06:25,600
G best.

104
00:06:26,470 --> 00:06:32,770
So this loop will run the way minus one times and each time this loop is running.

105
00:06:33,160 --> 00:06:36,250
What I have to do, I have to seek out value.

106
00:06:37,300 --> 00:06:40,240
And also I have to increment value.

107
00:06:40,570 --> 00:06:41,890
Because next time.

108
00:06:42,940 --> 00:06:47,170
Because next time after I will do a loop under after two to live enter.

109
00:06:48,030 --> 00:06:48,300
Okay.

110
00:06:48,670 --> 00:06:51,060
So I have to incrementally value also.

111
00:06:53,350 --> 00:06:59,650
Now at this point of time I have printed I yet through Vendel has been printed completely.

112
00:07:00,040 --> 00:07:03,560
So I will go to next line and we're going to next line.

113
00:07:03,580 --> 00:07:05,800
We will write C out and line.

114
00:07:06,770 --> 00:07:08,600
But this is the complete logic.

115
00:07:09,830 --> 00:07:10,700
You can see the gold.

116
00:07:18,460 --> 00:07:22,150
OK, so let us test our program for different values of an.

117
00:07:24,900 --> 00:07:26,610
So here is there is an error.

118
00:07:27,900 --> 00:07:28,110
OK.

119
00:07:28,200 --> 00:07:30,850
So it will be Duplass best and then semicolon.

120
00:07:32,190 --> 00:07:35,190
OK, now let us run our program.

121
00:07:39,350 --> 00:07:41,380
Suppose the value of end is three.

122
00:07:42,740 --> 00:07:44,160
So output is correct.

123
00:07:45,850 --> 00:07:48,280
Now, I suppose they're really off.

124
00:07:48,380 --> 00:07:49,190
And is.

125
00:07:50,310 --> 00:07:50,850
Five.

126
00:07:53,970 --> 00:07:56,010
So output is correct.

127
00:07:57,100 --> 00:07:57,360
OK.

128
00:07:59,210 --> 00:08:00,290
You can see the gaudier.

129
00:08:06,280 --> 00:08:09,510
So first of all, our logic was I have to print Androes.

130
00:08:10,810 --> 00:08:16,900
So this look I equals one, I less than less to win and I plus plus this with the help of these three,

131
00:08:16,990 --> 00:08:19,900
my local children and dimes, because we have to print Ando's.

132
00:08:21,600 --> 00:08:26,820
Then we have decided that we will print and minus I species.

133
00:08:27,890 --> 00:08:31,880
So canticles one countless dingo's to end minus eight and count plus plus.

134
00:08:32,150 --> 00:08:39,350
So this loop will go on and minus eight times and each time I am printing Speace correct.

135
00:08:40,490 --> 00:08:47,640
After that, we decided that we have to print the way, we have to print the way minus one values.

136
00:08:48,260 --> 00:08:51,200
So I need a loop there to learn the way minus one times.

137
00:08:51,830 --> 00:08:57,260
So in the Jaquiss one J less tangles to do a minus one and G plus plus.

138
00:08:57,770 --> 00:09:03,350
So at Delp of these three this loop will run the way minus one times and we have decided that we will

139
00:09:03,350 --> 00:09:07,490
start printing Relu starting from one, then two, then three and so on.

140
00:09:08,090 --> 00:09:14,450
So for that reinitialize to a variable value which is initially one and each time we are printing this

141
00:09:14,450 --> 00:09:21,590
value and each time we had incrementing the value by one and after printing the entire rule, I will

142
00:09:21,590 --> 00:09:22,850
go to the next line.

143
00:09:22,880 --> 00:09:24,260
So see out and Lane.

144
00:09:25,010 --> 00:09:26,810
So this is the complete logic.

145
00:09:28,390 --> 00:09:30,660
OK, so this problem was easy.

146
00:09:31,970 --> 00:09:33,320
So this is it for this video.

147
00:09:33,560 --> 00:09:34,430
Thanks for watching.
