IQ.IV · ISTQB CTFL practice question
Consider the following pseudocode: 1: read(x) 2: if x >= 0 then 3: x = x + 1 4: endif 5: if x > 10 then 6: print('High') 7: endif Which single test input achieves 100% statement coverage of this pseudocode?
Check answer and explanation
Correct answer: x = 11
Explanation
With x = 11: line 2 (11 >= 0) is true so line 3 executes (x becomes 12); then line 5 (12 > 10) is true so line 6 executes ('High'), covering every executable statement.
Common trap
With x = 11: line 2 (11 >= 0) is true so line 3 executes (x becomes 12); then line 5 (12 > 10) is true so line 6 executes ('High'), covering every executable statement.
Source: Original unofficial practice; not an official ISTQB exam item
Checked against the cited text on 2026-11-30.