00:01
Welcome to this lesson.
00:02
In this lesson we write a c+ + program and a function called maximum that will pass three data to it, three arguments with and they will return the maximum of the three.
00:20
So we need a function to be a double presection because we return that.
00:27
So say double maximum.
00:37
So half three, we would have three arguments.
00:41
So we will say double x, double y, double z.
00:51
So with this, we'll compare to which of them is the maximum.
00:59
So we'll say if x is greater than y.
01:09
And we'll do if x, if x is greater or equal to y.
01:21
And x is greater or equal to z.
01:29
I return x.
01:32
Okay.
01:33
I'll say else if y is greater or equal to x.
01:43
And if the same y is greater or equal to z.
01:50
Then in this sense, i'll return the y, else, or return z.
02:02
All right.
02:05
So here, you can have, okay, so at this point, i will say c out.
02:21
In the main method, see, i will say the maximum of the three is.
02:34
So this i'll pass.
02:37
Then i'll call the maximum and pass in three.
02:41
So i will say 3 .9, 5 .1 and 0 .1...