Control Flow & Loop Tracing

Answer & solution
Answer: A (no official key was published)
1. After i iterations, n is the original prefix d1...dm−i, and rev is the processed suffix in reverse order dm dm−1...dm−i+1, A. Each step removes n’s final digit and appends it to rev.
2. The notation describes numeric digit values, so leading zeros in the reversed suffix do not change the value; assume the input is supplied nonnegative and the reversed value fits int.
3. Teaching check: For input 1234, successive (n,rev) pairs are (123,4),(12,43),(1,432),(0,4321). This verifies both halves of the invariant simultaneously. An OR condition that merely describes the initial or final arrangement does not express the state after every iteration.