Hi, I have written a small piece of code that runs through a loop of 100 array elements. It compares a variable (conttot) to each of these elements and tests to see if it is larger. If the variable is larger it shifts the other elements down the array by 1 place to make room for the new element. The new element is then inserted in the correct place (above the smaller values in the array)
I have been trying to debug this for a while, but with no success.
The output i am getting is the biggest value in the first slot, and the second largest element duplicated all the way down to the 100th.
can anybody see where the problem may be?
thx in advance
//tests each element starting with biggest.
//shift all the other elements down to make room for the newest..
//place the new element in its correct slot