Throwing out highest and lowest values from a group of values

Hi all,

Quick question. How would one go about taking 5 to 10 numbers and throwing out the highest and lowest value after finding those two values? Can only use functions to do this. No arrays or strings or anything. I'm having trouble figuring out how to do this and keep the values stored then passed to the function that needs those values. Thanks.
You could do this with if statements,

create two ints, high and low and initialise them to 0

then you can do two if statements

e.g.

if x > high
high = x


if x < low
low = x
OK, that makes sense but how do I put that into a statement or function with the five values? I mean, I understand I would have to get the 5 to 10 scores using cout << "Enter score: "; and I guess I would then have to call a function to do that x amount of times correct? but then I'm stuck as to how to get those data into a function to then pick out the highest and lowest value...
Topic archived. No new replies allowed.