There are two approaches. The first works whether you have values stored in array or not.
Look at:
http://www.cplusplus.com/reference/limits/numeric_limits/
Would it make sense to start your code with:
1 2
|
int High_Score = std::numeric_limits<int>::min();
int Low_Score = std::numeric_limits<int>::max();
|
Do you agree that no matter what input you will get, it cannot be lower than initial value of High_Score? Low_Score has similar situation.
Now, when you look at every new value, it might be higher than High_Score. In that case you should update the High_Score. Can you see why, after seeing all values, the High_Score will have expected value?
Similarly, when you look at every new value, it might be lower than Low_Score. In that case you should update the Low_Score.
The second approach is more suitable for existing array of values. There you know that you have at least one value. Therefore, you can initialize both High_Score and Low_Score with the first element of the array and then proceed with the rest of elements like in the first approach.
There is also
http://www.cplusplus.com/reference/algorithm/minmax_element/
but you are supposed to think and practice, rather than resort to premade solutions (even though their proper use is a [different] challenge).