Correctness, Invariants & Design

Your answer
Answer & solution
Answer: C: gcd of the original integers (no official key was published)
For X>Y, gcd(X,Y)=gcd(X−Y,Y), because the common divisors are unchanged by subtraction. The symmetric identity holds when Y>X. Thus every loop preserves the original gcd. Both variables remain positive, and their sum strictly decreases on each iteration, so the process terminates. At termination X=Y, whose gcd is that common value. The printed result is therefore the original gcd, not their lcm or the quotient of a single division.