ProgrammingModerate

For the grid [[1, 2, 3], [4, 5, 6]], what is the sum of the column 2 values (the third column, 0-based index 2)?

  1. A. 5
  2. B. 7
  3. C. 8
  4. D. 9

Correct answer: D. 9

Column index 2 is the third column: row 0 gives 3 and row 1 gives 6, so the sum is 9. 7 uses column 1 (2 + 5) and 5 uses column 0 (1 + 4), both 0-based slips.

More C Programming questions

Exams that ask this topic