Example 1 — Fix a countdown that skips 1
Show the steps and the answer
Run it again and write down the output: 3, 2, Go. The 1 is missing.
Seeing the same wrong output twice shows the bug is real, and it tells you what to look for: the missing 1.
Trace n: n = 3 prints 3, n = 2 prints 2, then n = 1 and the check 1 > 1 is false, so the loop stops.
Following the value of n shows the exact moment the program goes wrong.
Guess the cause: the loop should still run when n is 1, so the check should be n > 0.
The guess points to one line. Changing only that line keeps the rest of the program the same.
Run the fixed program: 3, 2, 1, Go. Then start at n = 5: it prints 5, 4, 3, 2, 1, Go.
A second starting number shows the fix works in general, not only for 3.
Answer: Change the loop check from n > 1 to n > 0. The program now prints 3, 2, 1, Go.
Takeaway: Follow the variable step by step until the output goes wrong. That step tells you which line to fix.