
Use pseudocode tracing to check a loop's stopping point
Four display cards are numbered 1, 2, 3 and 4. The fictional instruction is to visit each card exactly once, in ascending order. A loop that says it handles four cards might still stop before card 4. To find out, write down the position at every condition check, the card visited when the condition is true, and the position after the update. The failed check belongs in the record too: it identifies where execution stops. For pseudocode tracing , verify each step.
Read guide →





















