1
00:00:01,610 --> 00:00:03,260
Hey, guys, what's up?

2
00:00:03,800 --> 00:00:08,000
So in the last class, we learned about four loops, and I told you that.

3
00:00:09,190 --> 00:00:12,880
We will solve some problems with the help of follows to get a better understanding.

4
00:00:13,120 --> 00:00:14,320
So this is the first problem.

5
00:00:14,560 --> 00:00:16,090
So the problem statement is very simple.

6
00:00:16,120 --> 00:00:21,760
We just have to multiply two numbers, but without multiplying them, without multiplying them means

7
00:00:21,880 --> 00:00:23,740
you cannot write A multiplier by B.

8
00:00:23,770 --> 00:00:24,550
So this is wrong.

9
00:00:25,240 --> 00:00:26,860
But you have to multiply the numbers.

10
00:00:27,280 --> 00:00:32,950
So we all know that image by baby is him as addition of a B times.

11
00:00:34,170 --> 00:00:34,410
OK.

12
00:00:34,720 --> 00:00:37,070
So if you want someone to bear to multiply by three.

13
00:00:37,120 --> 00:00:39,070
So this is two plus two plus two.

14
00:00:39,470 --> 00:00:42,130
That is added to three number of times.

15
00:00:42,220 --> 00:00:42,850
So six.

16
00:00:43,530 --> 00:00:43,740
OK.

17
00:00:44,080 --> 00:00:47,860
So you multiply by B's same as add a B times.

18
00:00:48,280 --> 00:00:52,080
So I need a loop and this loop will run B times.

19
00:00:52,690 --> 00:00:54,880
So each time this loop is running, what I will do.

20
00:00:54,910 --> 00:00:56,290
I will maintain a variable sum.

21
00:00:56,530 --> 00:00:57,880
And I will do some equals.

22
00:00:57,970 --> 00:00:58,780
Some Plessey.

23
00:00:59,350 --> 00:00:59,600
OK.

24
00:00:59,830 --> 00:01:02,290
So this problem can easily be solved by via loop.

25
00:01:02,590 --> 00:01:05,140
And this problem can easily be solved by a for loop.

26
00:01:05,380 --> 00:01:10,570
But I will solve this problem with the help of for loop so that you get a better understanding of how

27
00:01:10,570 --> 00:01:13,990
for Lookbook we have done enough number of Papis on y loop.

28
00:01:14,050 --> 00:01:17,110
Now this is the time for practicing a little bit of for loop.

29
00:01:17,880 --> 00:01:18,120
OK.

30
00:01:18,490 --> 00:01:19,930
So I think you understand the logic.

31
00:01:20,280 --> 00:01:21,550
So logic is very simple.

32
00:01:21,910 --> 00:01:26,920
For example, if you want to multiply two into five, what you will do, you will add two to five times

33
00:01:26,920 --> 00:01:28,540
as two plus two plus two plus two.

34
00:01:28,930 --> 00:01:30,360
So this is 10.

35
00:01:30,820 --> 00:01:34,330
Similarly, if you want to multiply B eight, multiply baby.

36
00:01:34,360 --> 00:01:34,930
What do will.

37
00:01:35,890 --> 00:01:37,420
You will do something like this.

38
00:01:37,960 --> 00:01:38,650
Eight plus eight plus.

39
00:01:38,650 --> 00:01:39,670
Say how many times.

40
00:01:39,700 --> 00:01:40,930
B times.

41
00:01:41,380 --> 00:01:41,610
OK.

42
00:01:41,860 --> 00:01:43,240
So what is multiplication.

43
00:01:43,570 --> 00:01:45,270
Multiplication is actually nothing.

44
00:01:45,340 --> 00:01:49,840
Multiplication is actually anything we can call it as it is repetitive.

45
00:01:50,620 --> 00:01:52,750
It is repetitive addition.

46
00:01:54,420 --> 00:01:55,550
So multiplication is nothing.

47
00:01:55,690 --> 00:01:58,200
It is just repetitive additions.

48
00:01:58,840 --> 00:02:00,490
So our logic is very simple.

49
00:02:00,670 --> 00:02:06,500
I run a loop been a matter of times and each time you are running a loop, we will mention a variable

50
00:02:06,510 --> 00:02:08,560
sum added to the variable sum.

51
00:02:08,890 --> 00:02:09,110
OK.

52
00:02:09,520 --> 00:02:11,250
So now where does all this problem?

53
00:02:12,360 --> 00:02:14,490
So let's hear the name of this is.

54
00:02:16,320 --> 00:02:19,340
So what should we name it, multiply?

55
00:02:21,390 --> 00:02:25,380
So we are naming it multiply, not CBB.

56
00:02:44,180 --> 00:02:45,530
So what we have to do first.

57
00:02:45,650 --> 00:02:52,580
I will take in a motel, then put slatted in a Mazari and we will give us the valley of envy and we

58
00:02:52,580 --> 00:02:53,910
have to work to play in the valley of.

59
00:02:54,020 --> 00:02:55,790
And be lucky.

60
00:02:56,300 --> 00:02:57,380
So what I need.

61
00:02:57,470 --> 00:02:58,220
I need a loop.

62
00:02:58,280 --> 00:03:05,150
And first of all, I need some initialism will be zero if you will not initialize the sum will contain

63
00:03:05,150 --> 00:03:07,250
garbage value and the output will be wrong.

64
00:03:07,640 --> 00:03:09,620
So initiation of some is very important.

65
00:03:10,010 --> 00:03:10,820
Not the for loop.

66
00:03:11,240 --> 00:03:12,770
How many times we have to run this loop.

67
00:03:12,830 --> 00:03:14,300
We have to run this loop B times.

68
00:03:14,360 --> 00:03:15,020
So I equals.

69
00:03:15,320 --> 00:03:20,590
So I equals when I last 10 articles to be a plus plus.

70
00:03:21,950 --> 00:03:22,650
What do you do.

71
00:03:23,180 --> 00:03:26,350
You will add the value of a two sum.

72
00:03:26,660 --> 00:03:27,900
So some equals simplicity.

73
00:03:28,400 --> 00:03:31,310
And finally you will print the value of some.

74
00:03:31,760 --> 00:03:34,460
Now how to check whether my output respect or not.

75
00:03:35,210 --> 00:03:35,900
What will I do?

76
00:03:35,990 --> 00:03:39,590
I will also print C out in to B.

77
00:03:40,770 --> 00:03:41,110
Okay.

78
00:03:41,660 --> 00:03:45,380
So now let's see whether our logic is correct or not.

79
00:03:48,600 --> 00:03:51,110
Let's say the first number, the well, your face 20.

80
00:03:51,660 --> 00:03:53,290
And my second number is.

81
00:03:53,760 --> 00:03:55,010
Let's see if I have 24.

82
00:03:56,220 --> 00:03:56,610
So.

83
00:03:57,740 --> 00:03:58,260
Our our.

84
00:03:58,620 --> 00:03:59,040
Correct.

85
00:03:59,160 --> 00:04:00,450
So one zero four zero.

86
00:04:01,110 --> 00:04:02,880
So the first one is due to some.

87
00:04:02,910 --> 00:04:05,020
And the second one is due to a multiplier baby.

88
00:04:05,780 --> 00:04:07,770
So our court is hundred percent correct.

89
00:04:08,220 --> 00:04:10,920
You can also implement this with the help of my loop.

90
00:04:11,400 --> 00:04:13,830
So what do we do if we want to use VI loopier?

91
00:04:15,210 --> 00:04:16,530
So our logic is very simple.

92
00:04:17,130 --> 00:04:22,780
You will, right, and I quote one while now you will read the condition.

93
00:04:22,800 --> 00:04:25,050
Condition is listed in articles to be.

94
00:04:25,620 --> 00:04:29,410
You will add some because some plus eight.

95
00:04:30,000 --> 00:04:31,990
And then you will write a plus plus.

96
00:04:32,870 --> 00:04:34,560
OK, so this is my condition.

97
00:04:35,400 --> 00:04:36,480
This is my condition.

98
00:04:37,200 --> 00:04:38,670
This is my initialization.

99
00:04:39,150 --> 00:04:40,770
This is my initialization.

100
00:04:42,990 --> 00:04:44,040
This is my condition.

101
00:04:44,100 --> 00:04:46,290
And finally, this is my condition.

102
00:04:46,800 --> 00:04:47,940
Sorry, this was subdued.

103
00:04:49,350 --> 00:04:51,480
This was update and this is update.

104
00:04:52,890 --> 00:04:53,160
OK.

105
00:04:54,530 --> 00:05:00,980
So the principle behind the working off fall of NY Loop is exactly same, when the next we do, we will

106
00:05:00,980 --> 00:05:03,680
solve one more question to get a better understanding or for loop.

107
00:05:04,020 --> 00:05:04,260
OK.

108
00:05:04,580 --> 00:05:05,480
So this is it for this.

109
00:05:05,480 --> 00:05:07,340
We know if you have any doubt, feel free to ask.

110
00:05:07,400 --> 00:05:07,970
Thank you.
