posted 23 years ago
The reason is that for loop executes only for the values 0,4,5 and 6. When the loop executes for the 1st time it throws the exceptions and the value of i becomes 4 next time it enters into the for loop again.
Actually the body of the loop changes the value of i from 0 to 3, and the increment statement of the for loop makes it 4.
4 and 5 are printed and when i becomes 6 exceptions are thrown again and the value of i becomes greater than 10, there by terminating the loop.
Bibhuti Dutta