1
00:00:02,090 --> 00:00:03,680
Hey, guys, what's up?

2
00:00:04,040 --> 00:00:08,180
So today we will learn how to pass any dual function.

3
00:00:08,930 --> 00:00:11,240
Okay, so this is the topic for today's class.

4
00:00:11,630 --> 00:00:14,420
How to pass at is indoor function.

5
00:00:15,570 --> 00:00:16,760
So let's see the goal.

6
00:00:18,060 --> 00:00:21,330
So I even named this filer's biasing idea to functions.

7
00:00:21,990 --> 00:00:27,920
So let us first take how many number of elements are there in entity the scene.

8
00:00:28,020 --> 00:00:32,770
And now let us make NRD offsides.

9
00:00:32,980 --> 00:00:38,220
And now let us take and loses input.

10
00:00:38,430 --> 00:00:38,920
So forward.

11
00:00:38,970 --> 00:00:40,440
And I equals zero.

12
00:00:41,360 --> 00:00:43,620
I illest and n a plus.

13
00:00:43,620 --> 00:00:43,980
Plus.

14
00:00:46,760 --> 00:00:48,660
So in a off I.

15
00:00:52,470 --> 00:00:57,320
OK, so what we do is let us create a brain function that will print.

16
00:00:58,230 --> 00:01:00,420
So I have a brain function.

17
00:01:00,840 --> 00:01:03,890
So what brain function will take it will take a.

18
00:01:04,170 --> 00:01:05,520
Which is Eddie as input.

19
00:01:10,430 --> 00:01:11,460
No, no, that's right.

20
00:01:11,480 --> 00:01:17,250
Brain function here so that you don't die will be wired because brain function will not return anything.

21
00:01:17,280 --> 00:01:19,590
It will just print the content of the edit.

22
00:01:20,820 --> 00:01:25,920
So you have to write and a if you will write into it means an integer.

23
00:01:27,030 --> 00:01:28,350
So you have to write like this.

24
00:01:28,590 --> 00:01:29,820
This means any.

25
00:01:31,380 --> 00:01:33,300
And now you have to just print.

26
00:01:33,750 --> 00:01:36,990
So for printing what I have to do, I will just I did already.

27
00:01:38,010 --> 00:01:42,750
So Ford and I equals zero.

28
00:01:58,360 --> 00:02:03,890
So this isn't normal logic, but that above, which will bring the content of the ERRY, but here I

29
00:02:03,900 --> 00:02:09,250
am using a variable and so I have to take the size of the eddy as well.

30
00:02:10,010 --> 00:02:11,320
So similarly, I will print.

31
00:02:11,410 --> 00:02:14,970
I will pass the size of the eddy as input.

32
00:02:15,550 --> 00:02:15,780
Okay.

33
00:02:15,910 --> 00:02:16,930
So this is important.

34
00:02:17,410 --> 00:02:20,010
We have to also pass the size of the areas in Bertolli.

35
00:02:20,170 --> 00:02:20,650
Function.

36
00:02:25,110 --> 00:02:31,530
So there are five elements and the elements are two, four, five, six and three.

37
00:02:32,670 --> 00:02:34,380
So the values are getting printed.

38
00:02:34,590 --> 00:02:37,880
So this print function is printing the content of the eddy.

39
00:02:40,320 --> 00:02:41,570
Now, let this come into doubt.

40
00:02:42,420 --> 00:02:48,240
So now what we want to do is we want to find the sum of all the elements of the eddy.

41
00:02:49,400 --> 00:02:50,440
OK, so let's do it.

42
00:02:51,490 --> 00:02:56,680
So what this function will return, this function will are done, some of the elements.

43
00:02:56,740 --> 00:02:59,110
So this function will be done and integer value.

44
00:03:00,010 --> 00:03:06,880
So intenser equals, let's say the name of the function is some what it will do.

45
00:03:07,030 --> 00:03:10,400
It will take as input and also the size of the eddy.

46
00:03:10,780 --> 00:03:11,790
Do I date of the 80.

47
00:03:12,220 --> 00:03:17,950
So this is important because if we don't know the value of n how we will do that with the.

48
00:03:18,700 --> 00:03:20,310
So that I don't type of dysfunction is.

49
00:03:20,470 --> 00:03:26,260
And because we have to retain the same name of the functionalism, it will take Eddie.

50
00:03:26,400 --> 00:03:26,570
So.

51
00:03:26,600 --> 00:03:27,310
And Eddie.

52
00:03:28,780 --> 00:03:31,060
And it will also take the size of the Eddie.

53
00:03:33,130 --> 00:03:34,510
Now we know how to find this out.

54
00:03:34,510 --> 00:03:34,900
The Eddie.

55
00:03:35,890 --> 00:03:38,290
So and answer is initially zero.

56
00:03:38,380 --> 00:03:40,990
We have to initialize our answer with zero.

57
00:03:41,050 --> 00:03:43,660
Otherwise it will contain garbage.

58
00:03:43,900 --> 00:03:46,410
You know, we just have to hydrate.

59
00:03:46,540 --> 00:03:48,700
So four and I equals zero.

60
00:03:48,770 --> 00:03:51,010
I less than an A plus.

61
00:03:51,010 --> 00:03:54,580
Plus, we will add the current value to my answer.

62
00:03:54,610 --> 00:03:58,110
So answer plus equals eight of a..

63
00:03:59,220 --> 00:04:00,550
Now this is all that we have to do.

64
00:04:00,580 --> 00:04:06,760
Finally, after calculating this, um, we will return that sum to the calling function, which is mean.

65
00:04:07,900 --> 00:04:09,430
And after getting the sum here.

66
00:04:09,490 --> 00:04:10,630
After getting the answer.

67
00:04:11,140 --> 00:04:12,460
What I will do, I will.

68
00:04:12,780 --> 00:04:13,760
Brent Sum.

69
00:04:13,950 --> 00:04:14,240
Brent.

70
00:04:14,480 --> 00:04:14,860
Answer.

71
00:04:18,890 --> 00:04:20,390
OK, so let's test out program.

72
00:04:22,110 --> 00:04:24,240
So in some coma.

73
00:04:27,310 --> 00:04:28,050
So I'm dining.

74
00:04:28,210 --> 00:04:29,780
Sorry, head will be answered.

75
00:04:34,030 --> 00:04:37,630
So there are, let's say, three elements, Nedry and elements are 120.

76
00:04:38,160 --> 00:04:39,100
So I'm out four days.

77
00:04:39,280 --> 00:04:41,470
My some of the elements are six.

78
00:04:42,760 --> 00:04:48,240
If there are, let's say, five elements and the elements are one, two, three, four and five, four

79
00:04:48,240 --> 00:04:49,710
or five and let's say when.

80
00:04:50,730 --> 00:04:53,690
So I produce four degree 34 plus five.

81
00:04:53,710 --> 00:04:54,850
Thirty nine plus one.

82
00:04:55,180 --> 00:04:58,090
Forty, forty two and forty three.

83
00:04:59,650 --> 00:04:59,860
OK.

84
00:04:59,920 --> 00:05:03,790
So this is how we will pass Eddie to the function.

85
00:05:04,120 --> 00:05:06,130
So we have to pass two things first.

86
00:05:07,480 --> 00:05:08,650
So we have to pass two things.

87
00:05:08,650 --> 00:05:13,360
First, that Eddie and second, the size of the area because we have to ideato the Eddie.

88
00:05:14,950 --> 00:05:24,340
Now, the most important thing they are going to discuss is Eddie, are always biased.

89
00:05:25,620 --> 00:05:27,750
By their friends.

90
00:05:30,670 --> 00:05:33,210
So Ed is always passed by the fence.

91
00:05:33,340 --> 00:05:34,930
So what is the meaning of this statement?

92
00:05:34,960 --> 00:05:35,450
Let's see.

93
00:05:38,600 --> 00:05:40,040
So, for example.

94
00:05:41,560 --> 00:05:43,210
If I will change the value.

95
00:05:44,230 --> 00:05:45,080
So let's see.

96
00:05:45,250 --> 00:05:47,380
I am changing the value of the first element.

97
00:05:48,100 --> 00:05:50,110
Let's say the value is five.

98
00:05:51,010 --> 00:05:52,720
So this value will be changed.

99
00:05:53,530 --> 00:05:55,350
Now, I am printing daddy first.

100
00:05:55,590 --> 00:05:55,920
Daddy.

101
00:05:57,160 --> 00:05:59,080
And after calculating Lissome again.

102
00:05:59,080 --> 00:05:59,580
Vendetti.

103
00:06:00,490 --> 00:06:04,470
So print a comma and.

104
00:06:07,150 --> 00:06:07,440
OK.

105
00:06:08,530 --> 00:06:09,610
So let's come it out.

106
00:06:12,750 --> 00:06:16,400
So what we did is we just changed the first reilley of the area.

107
00:06:18,480 --> 00:06:24,840
Suppose there are five elements in the array and the elements are one, two, three, four and five.

108
00:06:26,820 --> 00:06:29,070
So you can hear the element was one.

109
00:06:29,250 --> 00:06:35,400
Now, the first element has become five because I have written I have changed the zero index value of

110
00:06:35,400 --> 00:06:36,420
zero equals five.

111
00:06:37,170 --> 00:06:37,380
OK.

112
00:06:37,520 --> 00:06:41,240
That is are always passed by reference one more time later.

113
00:06:41,400 --> 00:06:44,250
There is only one element and that element is three.

114
00:06:45,750 --> 00:06:48,170
So first we will do the normal print three.

115
00:06:48,270 --> 00:06:51,720
And after we call the sum function, some function will change the value to five.

116
00:06:51,750 --> 00:06:53,160
Then five is getting printed.

117
00:06:53,910 --> 00:06:54,590
So let's see.

118
00:06:57,320 --> 00:06:58,410
So what is happening here?

119
00:06:58,860 --> 00:07:04,160
First, you are calling brain function, brain function will normally print the content of the array,

120
00:07:04,620 --> 00:07:06,240
then you're calling the function some.

121
00:07:06,690 --> 00:07:10,170
Some function is changing the value of a of the zero.

122
00:07:11,340 --> 00:07:13,920
OK, and then you are again printing, Eddie.

123
00:07:17,030 --> 00:07:24,140
So this is normal input that I am printing of zero, then I'm calling some function what some function

124
00:07:24,140 --> 00:07:24,620
will do.

125
00:07:24,980 --> 00:07:28,490
It will change the value of a of zero to 123.

126
00:07:29,060 --> 00:07:34,550
And finally, after calling the function some, I am printing the value of a zero again.

127
00:07:38,410 --> 00:07:45,730
So let's say there are five elements in the area and the elements are one, four, five, three and

128
00:07:45,730 --> 00:07:46,240
six.

129
00:07:47,830 --> 00:07:50,320
So the first value of zero.

130
00:07:50,590 --> 00:07:51,670
You can here you can see.

131
00:07:52,810 --> 00:07:57,340
So if zero is one and a Odilo becomes a 123.

132
00:07:59,710 --> 00:08:02,140
OK, so why it is so.

133
00:08:02,470 --> 00:08:05,620
Because it is are passed by their friends.

134
00:08:06,340 --> 00:08:06,630
OK.

135
00:08:08,240 --> 00:08:10,160
So if you have any doubt, feel free to ask.

136
00:08:10,610 --> 00:08:11,870
So this is it for this video.

137
00:08:12,410 --> 00:08:12,950
Thank you.
