Ask Question
18 June, 23:57

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

+4
Answers (2)
  1. 19 June, 00:37
    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;

    }
  2. 19 June, 02:20
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the definition of a function max that has three int parameters and returns the largest. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers