Ask Question
20 February, 10:02

Write the definition of a function max that has three int parameters and returns the largest.

+4
Answers (2)
  1. 20 February, 11:00
    0
    Solution:

    The definition of a function max that has three int parameters and returns the largest is given bellow:

    def max (x, y, z):

    if (x>z and x>y):

    return (x)

    elif (y>x and y>z):

    return y

    else:

    return z

    Thus this is required right answer.
  2. 20 February, 13:56
    0
    int max (int x, int y, int z) {

    if (x > y && x > z)

    return x;

    else if (y > x && y > z)

    return y;

    else

    return z;

    }

    Explanation:

    I am going to write a c function for this.

    The arguments are the values, and it is a int function because it returns an integer. So

    The if clause is used to verify the largest value.

    int max (int x, int y, int z) {

    if (x > y && x > z)

    return x;

    else if (y > x && y > z)

    return y;

    else

    return z;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write the definition of a function max that has three int parameters and returns the largest. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers