An array has length n. A loop starts i at 0, increments i by 1, and must visit each valid index exactly once. Which condition is correct?
Explanation
Valid indexes for a nonempty array of length n run from 0 through n - 1, so i < n stops immediately before the out-of-range index n. Using i <= n permits one extra body execution and is the classic boundary mistake.