Shruti,
as u know about the post increment operators,
when post increment operator is applied to a variable j:
first the current value of j is the value of the expression, and then later on the value of j increments.
suppose u have
So the final value is evaluated as:
1)result = j;
2)j = j + 1;
3) return result;
Now solving ur question this way, u get
result = i;
i = i + 1;
i = result;
Thats how it gets solved
Hope u r clear
also look at this
Tips