How to find the highest number using an array
Posted on 2003-12-01
i have a problem which i have been trying to figure out for a couple of days but i can't seem to think of anyway of doing it, i am developing a little tool for myself to keep track of my scores in a sport i play...
The problem is here,
I have an array (size 11) with integers inside. I want to find the highest integer (i.e. score) in that array.
so for example if i have the following numbers in the array... 60, 12, 34, 56, 106 ... i would like to some how take the largest number out of the array which is 106 and store it in a int type variable.
This will allow me to keep track of my highest score. I have tried using a for loop but failed miserably, does anyone have an idea of how i can do this?
Thanks for your help.