subject
Computers and Technology, 23.04.2020 15:45 ryan1kk

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 */

And this is what I have:

void minMax(int x, int y, int z, int* big, int* small) {

if ((a > b) && (a > c)) {

a = big;

}

else if ((b > a) && (b > c)) {

b = big;

}

else if ((c > a) && (c > b)) {

c = big;

}

if ((a < b) && (a < c)) {

a = small;

}

else if ((b < a) && (b < c)) {

b = small;

}

else if ((c < a) && (c < b)) {

c = small;

}

}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:30
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Which text format is this, "the text is transcribed exactly as it sounds and includes all the utterances of the speakers. "?
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
You know the right answer?
Write the definition of a function minMax that has five parameters. The first three parameters are i...
Questions
Questions on the website: 13722359