A programmer is writing a loop that increments an index by 2 each time it runs. The...

Check the final answer first, then review the worked steps.

Answer

7

Work

  1. 1
  2. 1+2=3
  3. 3+2=5
  4. 5+2=7

Step-by-step solution

  1. Start with the index at $1$ for the first iteration.
  2. In each subsequent iteration, add $2$ to the current index.
  3. Iteration 1: $1$
  4. Iteration 2: $1 + 2 = 3$
  5. Iteration 3: $3 + 2 = 5$
  6. Iteration 4: $5 + 2 = 7$