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 13:00
Which option should u select to ignore all tracked changes in a document
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
Answers: 2
You know the right answer?
Write the definition of a function minMax that has five parameters. The first three parameters are i...
Questions
question
Mathematics, 13.10.2019 23:30
question
Mathematics, 13.10.2019 23:30
question
English, 13.10.2019 23:30