ITPEC IP April 2025 Question 7

Source exam: ITPEC IP April 2025Topic: Algorithm and Programming

ITPEC IP April 2025 — Question 7 of 100

Option (d) supplies the required condition and outputs — use the even/even test, output i when true, and output "+" otherwise.

For even outer-loop values i = 0, 2, 4, 6, the output shows i at even inner-loop positions j = 0, 2, 4, 6 and plus signs at odd positions. For odd i, the conjunction is false for every j, producing seven plus signs. Thus A is (i mod 2 = 0) and (j mod 2 = 0), B is i, and C is "+".

Answer (d)

Why not others: (a) and (b) test odd/odd positions, contradicting the digit positions. (c) uses the right condition but swaps the two outputs.

Key rule: Trace both loop indices: a conjunction runs its true branch only where both independent conditions hold.

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 IP past-paper collection or Report an issue.