1
00:00:02,230 --> 00:00:03,670
Hey, guys, what's up?

2
00:00:04,000 --> 00:00:07,150
So in this video, we will solve another industrial problem, one function.

3
00:00:07,780 --> 00:00:09,460
So the problem is very simple.

4
00:00:10,000 --> 00:00:13,390
We have to write a function, write a function.

5
00:00:15,440 --> 00:00:16,010
To of.

6
00:00:19,260 --> 00:00:19,780
NCR.

7
00:00:20,690 --> 00:00:23,280
So what is NCR, so NZEI?

8
00:00:23,370 --> 00:00:29,450
It was an factorial upon and minus Victoria and two of Victoria.

9
00:00:29,900 --> 00:00:32,600
OK, so this is the form love finding NCAR.

10
00:00:34,010 --> 00:00:38,300
So the value of N and art will be given by use it.

11
00:00:38,960 --> 00:00:40,430
So how we can find ends here.

12
00:00:41,000 --> 00:00:44,870
So we have to find first of all, we have to find and factorial.

13
00:00:45,080 --> 00:00:46,660
Then we will find odd factorial.

14
00:00:47,150 --> 00:00:49,430
And then we will find and minus our factory.

15
00:00:49,760 --> 00:00:50,990
And then we will divide.

16
00:00:51,850 --> 00:00:52,080
OK.

17
00:00:52,400 --> 00:00:54,490
And how to find a factorial phone number.

18
00:00:54,980 --> 00:00:55,700
We have sold.

19
00:00:56,000 --> 00:00:56,450
We have.

20
00:00:56,780 --> 00:00:58,440
We have seen it in the last radio.

21
00:00:59,000 --> 00:01:02,030
OK, so the last radio was how to find fact Orlova number.

22
00:01:04,670 --> 00:01:06,560
OK, so they destroyed the gold.

23
00:01:11,200 --> 00:01:19,840
So let us name this filer's function, NTR Nazi Beebee.

24
00:01:37,830 --> 00:01:41,150
So I would take and put two number and and ah.

25
00:01:45,110 --> 00:01:46,200
Now, what do we do?

26
00:01:47,940 --> 00:01:55,980
Let's make a variable answer, which is it goes to let's name the function as an S..

27
00:01:57,420 --> 00:01:59,850
And it will take two will loose as input.

28
00:02:00,180 --> 00:02:06,540
And and so NCAR is a function and what it will give me.

29
00:02:07,500 --> 00:02:12,930
And it will give me the value of NCAR to see out answer.

30
00:02:14,690 --> 00:02:16,680
Now let us implement NCAR function.

31
00:02:20,690 --> 00:02:22,400
So they're done by I will be.

32
00:02:22,700 --> 00:02:25,370
And because I have to return an integer value.

33
00:02:25,730 --> 00:02:30,410
So end and see what it will take to number as input.

34
00:02:31,040 --> 00:02:33,890
So end and and.

35
00:02:37,120 --> 00:02:38,240
And what we have to do.

36
00:02:39,590 --> 00:02:40,490
We have to redone.

37
00:02:44,400 --> 00:02:45,720
Factory love and.

38
00:02:48,890 --> 00:02:53,930
Divided by Victoria, Love and minus.

39
00:02:56,320 --> 00:02:58,910
And to Victoria Love.

40
00:03:00,650 --> 00:03:02,000
And now what we have to do.

41
00:03:02,090 --> 00:03:07,190
We have to implement a function that will find the Victrola phone number, which we have done in the

42
00:03:07,280 --> 00:03:08,030
last class.

43
00:03:08,570 --> 00:03:10,550
So this was the code.

44
00:03:11,490 --> 00:03:12,100
Let's cooperate.

45
00:03:13,730 --> 00:03:14,990
And where's your typist?

46
00:03:15,590 --> 00:03:17,110
So I'm calling function fact.

47
00:03:17,420 --> 00:03:20,490
So it should be placed above NCAR.

48
00:03:22,100 --> 00:03:22,300
OK.

49
00:03:22,490 --> 00:03:24,470
So I think our code is ready.

50
00:03:25,370 --> 00:03:31,460
So what I'm doing here is I am taking Tuvalu's as input and I'm calling the function ncar.

51
00:03:31,880 --> 00:03:39,650
So NCAR function to the value of NCI equals and factorial divided by and minus factorial and two are

52
00:03:39,770 --> 00:03:40,370
factorial.

53
00:03:41,640 --> 00:03:41,810
OK.

54
00:03:42,260 --> 00:03:43,610
So this function is calling.

55
00:03:44,750 --> 00:03:48,050
Fact, function, vectorial function to find these factorial.

56
00:03:49,010 --> 00:03:50,150
Okay, so how it works.

57
00:03:51,340 --> 00:03:53,990
First of all, I was I was having Maine.

58
00:03:54,550 --> 00:03:58,150
Men will call NCAR and see, I will call fact.

59
00:03:59,610 --> 00:04:00,760
Three times it will qualify.

60
00:04:01,020 --> 00:04:04,490
Two times, first four and then four and minus eight, then foot out.

61
00:04:05,130 --> 00:04:11,610
So for the first time, let's say for N it will LoDo work and it will redonda value to NCEA.

62
00:04:12,930 --> 00:04:21,240
So caustic would look something like this then and say, I will again call fact for calculating N minus

63
00:04:21,240 --> 00:04:27,510
R, then after calculating and returning the value of and minus eight factorial, the NCAR function

64
00:04:28,110 --> 00:04:30,330
will again call fact function.

65
00:04:30,720 --> 00:04:31,290
So effect.

66
00:04:32,280 --> 00:04:33,500
And it will be done differently.

67
00:04:33,650 --> 00:04:33,950
Love.

68
00:04:34,130 --> 00:04:34,370
Ah.

69
00:04:35,790 --> 00:04:36,660
Now what will happen.

70
00:04:37,020 --> 00:04:40,380
I will execute NCR so I have all the way loose.

71
00:04:40,590 --> 00:04:43,170
I have value off and factorial and minus of victory.

72
00:04:43,200 --> 00:04:43,860
Of victory.

73
00:04:44,160 --> 00:04:45,900
Now I will have done so.

74
00:04:45,990 --> 00:04:48,090
I will have done the answer to mean.

75
00:04:48,740 --> 00:04:50,130
Now what men will do.

76
00:04:50,490 --> 00:04:56,950
So the court was in town so it was NCAR and Gomaa and Main was printing the out answer.

77
00:04:57,660 --> 00:05:02,080
So meanwhile, the words work and after it will hurt, return zero treatment.

78
00:05:02,790 --> 00:05:06,540
Men will be bombed out and my stead becomes empty.

79
00:05:07,740 --> 00:05:10,410
Okay, now this is my entire code.

80
00:05:13,090 --> 00:05:13,720
Let's check.

81
00:05:15,940 --> 00:05:22,190
So I suppose the of friend is five and the value of foresty some outproduce coming out to.

82
00:05:22,660 --> 00:05:25,570
Then let's see whether my output is correct or not.

83
00:05:26,440 --> 00:05:35,560
So I have to calculate five C three, which is five factorial upon five minus three factorial.

84
00:05:36,710 --> 00:05:38,160
And do t factorial.

85
00:05:39,670 --> 00:05:45,130
OK, so five factorial is one twenty two factorial and three factorial.

86
00:05:45,670 --> 00:05:49,480
So when 20 were this two factorial, two were this two factorial.

87
00:05:49,750 --> 00:05:50,170
Six.

88
00:05:50,760 --> 00:05:53,370
So two sixty six then.

89
00:05:53,830 --> 00:05:54,640
So I put this.

90
00:05:54,680 --> 00:05:54,970
Ten.

91
00:05:56,510 --> 00:05:56,760
OK.

92
00:05:56,880 --> 00:05:57,700
So I'm out for this.

93
00:05:57,810 --> 00:05:58,210
Correct.

94
00:06:01,760 --> 00:06:04,280
Now, one more thing that I want to again clarify is.

95
00:06:06,960 --> 00:06:13,120
This and this are they both are different from this end and decide.

96
00:06:14,570 --> 00:06:14,840
Why?

97
00:06:14,930 --> 00:06:16,700
Because their scopes are different.

98
00:06:17,090 --> 00:06:22,030
So here, if you change the value of n supposed to and you will make ah, let's say three.

99
00:06:22,520 --> 00:06:25,460
They will not be any effect on the values of an NDR.

100
00:06:27,490 --> 00:06:27,760
OK.

101
00:06:28,090 --> 00:06:34,750
Similarly, this answer variable and this answer very well, they are completely different because they

102
00:06:34,750 --> 00:06:35,950
have different scope.

103
00:06:38,410 --> 00:06:42,610
Now, one more time you can see reusability of function.

104
00:06:42,720 --> 00:06:44,850
We are using the code.

105
00:06:45,340 --> 00:06:49,210
OK, so this is the main advantage of using functions.

106
00:06:51,120 --> 00:06:51,320
OK.

107
00:06:52,690 --> 00:06:54,850
So if you have any doubt, feel free to ask.

108
00:06:55,300 --> 00:06:55,820
Thank you.
