posted 16 years ago
Your subject line seems to indicate you're questioning why this is not an infinite loop (which running the code will confirm).
if(++x > y--) might look like an infinite loop, but note that it's inside a "do" loop with a condition of while(x < 5). So as soon as x == 5, execution will leave the "do" body.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org