Looks like a very inefficient way to do it with three loops.
Type: Posts; User: Norm
Looks like a very inefficient way to do it with three loops.
An else would be a tad more efficient in that if the first if is true, the second one can not be true.
that looks like it should be an else
What if two largest?
That makes it very hard to write a program if you do not know what steps the program is to take to solve the problem.
I often use a piece of paper and pencil to work out program logic BEFORE I try...
Why test against both?
Can you explain your logic?
Especially how you determine the second largest.