Skip to player
Skip to main content
Search
Connect
Watch fullscreen
Like
Bookmark
Share
More
Add to Playlist
Report
(Sigma batch 2025) product os a&b by shradha didi
Prateek Prajapati
Follow
4 months ago
Sigma batch by apna college
Category
📚
Learning
Transcript
Display full video transcript
00:00
Next question we will do is find product of A and B
00:03
We will give two numbers A and B
00:06
And we will find out their product
00:08
We will multiply A by B by the result
00:11
We will find out this
00:13
Return
00:14
So for this we will make a function
00:16
What will return type of function?
00:19
Return type int
00:20
Because we will make product and return it from the function
00:24
What can we keep this function?
00:26
We can keep the name of this function
00:28
And what will happen in this function?
00:30
There will be two parameters
00:32
The first parameter will be integer A
00:36
And the second parameter will be integer B
00:39
And my job is to multiply both in this function
00:43
So what will I do?
00:45
I will make a third variable
00:47
Which I will store A multiplied by B
00:50
And here I will return my product variable
00:55
I will always add public static
00:57
Because this is my access modifier
00:59
So I will return my product here
01:01
What will I do in the main function?
01:03
I will add call in the main function
01:05
I will multiply
01:06
I will pass in the multiply
01:07
I will pass A
01:08
I will pass A
01:09
Or I can pass 3 or B
01:11
I can pass 5
01:12
So we can pass directly values in our java functions
01:16
And then whatever output comes
01:18
I can store that output
01:20
In this new variable
01:23
Prod
01:24
Which I will do in the next
01:26
Print
01:27
So in this way my flow will be
01:29
I have to make this function
01:30
Which will be written
01:31
In the main function
01:33
I will call in the main function
01:35
I will pass 2 values
01:36
A and B
01:37
And the answer is returned
01:39
I will store it in this variable
01:41
I will then print
01:43
Print
01:44
So let's write this function
01:46
In the function
01:47
First we will write public
01:49
Static
01:50
Int
01:51
Because it will be return type
01:53
Int
01:54
The name we have to give
01:55
Multiply
01:56
In the multiply
01:57
First we will have a parameter
01:59
Integer A
02:00
Then Integer B
02:01
After that
02:02
What will I do?
02:03
I will make a variable
02:05
Product
02:06
In which I will store
02:07
A multiplied by B
02:08
And I will return
02:10
Product
02:11
Product
02:12
What will I do in the main function
02:15
In the main function
02:16
I will make two variables
02:17
Int A
02:18
Which I will store
02:19
3
02:20
Int B
02:21
Which I will store
02:22
5
02:23
Now I am going to call
02:24
Multiply
02:25
In the multiply
02:26
I have passed the same A and B
02:27
But since the call by value
02:28
So A and B
02:29
Is always copy and pass
02:30
Multiply
02:31
As I will return this function
02:32
I will give the product
02:34
I will store it here
02:36
How will I store it?
02:38
I will store it
02:39
A variable
02:40
In the prod
02:41
Now I will do the value
02:42
I will print
02:43
A multiplied by B
02:45
Is equal to
02:46
Save
02:47
And
02:48
A multiplied by B
02:49
Is equal to
02:50
Save
02:51
And
02:52
So A multiplied by B
02:53
Is equal to 15
02:54
Because 3 multiplied by 5
02:56
Is equal to 15
02:57
Because 3 multiplied by 5
02:58
Is equal to 15
02:59
So
03:04
In the whole code
03:05
When I have to multiply two numbers
03:06
I will simply
03:07
Where
03:08
I will multiply two numbers
03:09
Here
03:10
I will multiply 10
03:11
And
03:12
20
03:13
So
03:14
I will simply
03:16
Call
03:17
In the prod
03:18
Now I will store a new value
03:20
And
03:21
What will I do?
03:23
I will print it
03:24
So
03:25
Now I will have two multiplications
03:27
And
03:28
A into B
03:29
First of all
03:30
15
03:31
Then
03:32
10
03:33
And
03:34
20
03:35
Which is
03:36
200
03:37
So
03:38
When I will work
03:39
Two numbers
03:40
I will write a straight line
03:41
Which I can call the multiply function
03:42
Video
03:45
And
03:46
In
03:47
The
03:48
Of
03:49
No
03:50
No
03:51
But
03:53
You
03:54
The
03:55
likely
03:56
That
03:57
Was
03:58
That
03:59
Were
04:00
Us
04:01
You
04:02
I
04:03
I
04:04
Not
04:05
States
04:06
Any
04:07
You
04:08
Any
Be the first to comment
Add your comment
Recommended
8:15
|
Up next
(Sigma batch 2025) call by values by shradha didi
Prateek Prajapati
4 months ago
2:30
(Sigma batch)Introduction to a Function by shradha didi
Prateek Prajapati
4 months ago
5:10
(Sigma batch 2025) what happened in memory by shradha didi
Prateek Prajapati
4 months ago
6:23
(Sigma batch 2025) syntax with parameters by shradha didi
Prateek Prajapati
4 months ago
10:23
(Sigma batch 2025) syntax function code by shradha didi
Prateek Prajapati
4 months ago
1:55
(Sigma batch 2025) parameters v/s arguments by shradha didi
Prateek Prajapati
4 months ago
1:22
Sigma & Take That On GMB #Cry
Michelle Thornton
10 years ago
1:57
Sigma Girl Expression
Wrestling Arena Anime
3 years ago
2:02
Sigma FP Concept Movie
xataka
5 years ago
0:11
Sigma rule
Jack Sparrow
2 years ago
0:51
Former Aide Claims She Was Asked to Make a ‘Hit List’ For Trump
Veuer
2 years ago
1:08
Musk’s X Is ‘the Platform With the Largest Ratio of Misinformation or Disinformation’ Amongst All Social Media Platforms
Veuer
2 years ago
4:50
59 companies that are changing the world: From Tesla to Chobani
Fortune
2 years ago
0:46
3 Things to Know About Coco Gauff's Parents
People
2 years ago
1:18
USC vs. Colorado: Can Caleb Williams Earn a New Heisman Moment?
SportsGrid
2 years ago
1:04
Vic Mensa Reveals Celebrity Crush, Biggest Dating Pet Peeve & More on Speed Dating | Billboard News
Billboard
2 years ago
1:09
Hollywood Writers Reach ‘Tentative Agreement’ With Studios After 146 Day Strike
Veuer
2 years ago
1:26
Love is Blind stars admit they're burnt out from social media
Fortune
2 years ago
2:01
NHA Customers in Limbo as Company Faces Potential Merger
SportsGrid
2 years ago
2:55
Vanilla Ice Explains How the 90’s Shaped America
FACTZ
2 years ago
0:36
Amazon’ Prime Video Will Show Commercials Starting Next Year
Veuer
2 years ago
11:13
Pokimane Answers The Web's Most Searched Questions
WIRED
2 years ago
4:16
BREAKING NEWS: Matt Gaetz Tells House Committee: 'I'm Not Going To Vote For A Continuing Resolution'
Forbes Breaking News
2 years ago
1:00
What's Popular on Uber Eats?
Stringr
2 years ago
2:50
MÃ¥neskin Performs "HONEY" at MSG
Rolling Stone
2 years ago
Be the first to comment