Lets think what happens in the (original) loops.
You have i alone in the conditional expression. Although i is an integer, it can be used as boolean value. 0==i means false and 0!=i means true.
The input is N. A positive number. (If you type in a negative number, it should be clear that the I stays negative for a while.)
The outer loop test passes, for 0!=N.
The inner loop starts.
On each iteration it first prints value of i and then decreases it.
When 0==i, the inner loop ends and the i remains 0.
Now the outer loop has completed one iteration. Almost. It too will decrement i.
The first iteration of the outer loop is now entirely complete and i == -1.
The second iteration of outer loop would start, if 0 != i.
Oh yes, it isn't. It is already negative. Iteration continues.
That's a great explanation! Thanks a lot!