ITPEC FE Subject B October 2025 Question 1
Source exam: ITPEC FE Subject B October 2025Topic: Array Manipulation
ITPEC FE Subject B October 2025 — Question 1 of 20
The loop iterates i from k to m (inclusive). Two blanks must be filled:
- •A (condition):
array[i] mod 2 = 0— checks if the element is even (remainder 0 when divided by 2) - •B (increment):
i ← i + 1— advances the index forward each iteration
Why not others:
- (b) i ← i - 1 — index moves backward → infinite loop, never reaches endwhile
- (c) array[i] mod 2 ≠ 0 — selects odd elements, opposite of the requirement
- (d) wrong condition AND wrong increment — double error
Key rule: Even number check = value mod 2 = 0; always increment (i + 1) when iterating forward through an array.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.