First page Back Continue Last page Overview Graphics
int i = 10;
int n = i++%5;
Question: What are the values of i and n after the code is executed?
Answer: i is 11, and n is 0.
Question: What are the final values of i and n if instead of using the postfix increment operator (i++), you use the prefix version (++i))?
Answer: i is 11, and n is 1.