Correct Answer : {x = qy + r ∧ r < y}
Explaination :
The given pseudo code does following for given x and y which positive integers.
1) It initializes r as x.
2) It repeatedly subtracts y from r until r becomes
smaller than y. For every subtraction, it
increments count q.
3) Finally r contains remainder, i.e., x%y and q contains
⌊x/y⌋
See below pseudo code with comments.
begin
q := 0 // q is going to contain floor(x/y)
r := x // r is going to contain x % y
// Repeatedly subtract y from x.
while r >= y do
begin
r := r – y
q := q + 1
end
end