ValueLabs interview question

find second maximum number in the array using single for loop?