Exam practice

Cambridge IGCSE Computer Science trace table practice

Use one row for each completed loop iteration. Include the initial value separately so a zero-iteration loop still has a defined result.

Worked practice

Start total at 0. For each n in [3,1,4] set total to total + n. Trace rows (n,total) are (3,3), (1,4), (4,8). If the list is empty the output stays zero. No imaginary row needs to be added.

Try it yourself

A second program starts at i = 1 and counts while i < 3, adding one to i after each count. Which values are processed? How would you include 3? Trace the change.

Check your answer

The original processes 1 and 2. Changing the condition to “less than or equal to 3” processes 1, 2 and 3. In both versions the test happens before the loop body.

Exam reference

Check Cambridge IGCSE 0478 for the syllabus that matches your exam year and entry. These practice questions were written by Tutorwell.

Try a lesson tonight. Learn together.

Two minutes to set up. The first five-minute lesson is free, no card needed. Pick a subject your child has homework in.

Try the free lesson

Last checked . Tutorwell is an AI tutor, not a person, and it tells your child so.