The Highest of 10 values

Hello,
I need your Help Fast.

I need to analyze and extrapolate the highest from ten Values, Considering That the values ​​are all negatives .

Can you help me ?

Thank you

what do you mean by extrapolate?

int maxval = max(val1, max(val2, max(val3, max(val4, max(val5, max(val6, max(val7, max(val8, max(val9, val10))))))))))));

(I may have missed a few parens!)

KeithRB:
what do you mean by extrapolate?

int maxval = max(val1, max(val2, max(val3, max(val4, max(val5, max(val6, max(val7, max(val8, max(val9, val10))))))))))));

(I may have missed a few parens!)

Too many right parentheses.

amazingcrow:
Hello,
I need your Help Fast.

I need to analyze and extrapolate the highest from ten Values, Considering That the values ​​are all negatives .

Can you help me ?

Thank you

Is this homework?

amazingcrow:
I need to analyze and extrapolate the highest from ten Values, Considering That the values are all negatives .

If I understand what you are trying to do the simplest way to accomplish this is to read each value in one at time, compare each value to the greatest value already saved and then store the new value if it is greater. For example:

int greatestValue = 0;
if ( abs(newValue) > abs(greatestValue) )
{
    greatestValue = newValue;
}

And if you really don't care about positive numbers you can simplify to this:

int greatestValue = 0;
if ( newValue < greatestValue )
{
    greatestValue = newValue;
}
int greatestValue = 0x8000;

if ( newValue > greatestValue )
{
    greatestValue = newValue;
}

(your routine finds the minimum, a typo I guess).
To find the maximum value, signs do not matter,
negative values sort below positive ones.

The 'considering that the values ​​are all negatives' is only distraction.

P.S. I like the very terse and correct solution suggested by KeithRB.

Thank u all!!!