Question: I need help coming up with the function defintions for these two. Please help! In this part you will get experience writing void functions that

I need help coming up with the function defintions for these two. Please help!

In this part you will get experience writing void functions that return more than one result via reference parameters. Write the following two functions and add them to your menu:

MinMax: Takes 5 parameters, the first three are user-supplied inputs and the last two are result parameters. Place the smallest of the first three parameters into the fourth parameter (min) and the largest of the three parameters in the fifth parameter (max). When MinMax returns, the calling function will examine the fourth and fifth arguments and find the values placed there by MinMax. For example, if MinMax were called as:

int x = 3, y = 10, z = 1;

int min, max;

MinMax(x, y, z, min, max);

then min will be 1 and max will be 10 when MinMax returns. You will need to ask the user for three integers before calling this function.

Modulus: Takes 4 int parameters, the first two are user-supplied inputs and the last two are the quotient and remainder. The quotient is calculated by dividing the first parameter by the second parameter. The remainder is whatever is left after division. For example, if Modulus were called as follows:

int x = 17, y = 3;

int quotient, remainder;

Modulus(x, y, quotient, remainder);

then quotient will be 5 and remainder will be 2 after Modulus returns. You will need to ask the user for two integers before calling this function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!