Control Flow & Loop Tracing


Answer & solution
Answer: y := (x > 5); (no official key was published)
The comparison x>5 evaluates to a Boolean. In the true case, the original statement assigns true to y; in the false case, it assigns false. Assigning the comparison result therefore gives exactly the same value in both cases. At x=5, the result is false, so using ≥ instead would be incorrect. This simplification assumes y has Boolean type and the comparison has the ordinary Pascal semantics shown in the source. No branch or numeric Boolean encoding is needed.