# Write the definition of a function minMax that has five parameters.

### LANGUAGE: C++

### CHALLENGE:

Write the definition of a function minMax that has five parameters.

The first three parameters are integers.

The last two are set by the function to the largest and smallest of the values of the first three parameters.

The function does not return a value.

The function can be used as follows:

int a=31, b=5, c=19 big, small;

minMax(a,b,c,&big,&small);

/* big is now 31 */ /* small is now 5 */

### SOLUTION:

void minMax(int x, int y, int z, intbig, int small){ int min; int max; min = x; if (min > y){ min = y; } if (min > z){ min = z; } }