# Computer science

posted by .

If we have any five numbers. how do we find maximum and minimum number of those.

You take the first number and store it in variable Min and Max. Then you take the second number. If that number is larger than the variable Max you overwrite Max and store that varible there. If not then you check if it is smaller than the value stored in Min. If so, you store it there, overwriting the previous stored value. You repeat this for all five variables.

## Similar Questions

1. ### calculus

the second number is the reciprocal of the fist and the sm is a minimum. this is my my work and i got stuck x=first number y=second number so y=1/x then what. i know the answer is 1 and 1. also can you explain why the answer is 1 and …
2. ### Math

i^6 = (i^2)^3 = (-1)^3 = -1 The square, not the square root of -1 is 1. :) B.t.w., can you prove that -1 times -1 is 1?
3. ### math

Please help me to find the five-number summary of the following set of numbers.338, 226, 149, 391, 247, 501, 300, 223, 320 According to a definition I found online, "The five-number summary of the data consists of the minimum data …
4. ### Algebra II

One number is two less than a second number. If you take one-half of the first number and increase in by the second number, the result is at least 41. Find the least possible value for the second number. HELP PLEASE!!!! I hate word …
5. ### MAth

If 1 gallon (gal) of water weighs 8.34 pounds (lb), how much does 3.75 gal weigh?
6. ### Algebra I

The sum of three numbers is 147. The second number is 4 more than two times the first number. The third number is five less than three times the first number. Find the three numbers. Can you please solve it?
7. ### C programming

Question: Write a program that reads integers from the keyboard until the user enters the sentinel value -999. The program should then print the minimum integer read, the maximum integer read and the average of all the integers. (Excluding …
8. ### algebra 2

one number is two less than a second number. If you take one-half of the first number and increase it by the second number,the result is atleast 41. find the least possible value for the second number.