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.
barry i didnt get u ....try to get pc means... also barry if these sort of questions comes on exam in 1 means fine ..but if they are many i shall go mad ..also yesterday i was doing these dan questions ..i was right almost all..but my head was roaming here and there ...u got it what i mean ???