Running in a different low priority
thread to Mark (on paper

) I reckon you just forgot that after the last comparison i++ < j-- jumped out of the loop, i and j had been incremented respectively decremented. That is 8,5 gets you out of the loop but then i is 9 and j is 4. Makes you dizzy eh?
Actually I had problems doing one like this on the real exam - at the same time there were three people trying to get the PC next to me working.