ITPEC IP April 2026 Question 9
ITPEC IP April 2026 — Question 9 of 100
Join the four edge tests with OR — use i = 1 or i = n or j = 1 or j = n.
Rows i = 1 and i = n form the top and bottom edges. Columns j = 1 and j = n form the left and right edges. A star must be printed when any one of these four conditions holds, so they are joined with OR. Only cells for which none holds are interior spaces.
Answer (c)
Why not others:
- (a) joins the row-edge and column-edge tests with AND, so it prints only the four corners
- (b) is true for many interior positions and does not directly identify all borders
- (d) identifies only the interior, where both indices lie strictly between 1 and n
Key rule: The border of a matrix is the union of its first/last rows and first/last columns, so use OR; AND would keep only their intersections.
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.