ProgrammingVery hard

The sum of i + j over all cells of a 3 x 3 grid with indices 0 to 2 is what?

  1. A. 9
  2. B. 12
  3. C. 18
  4. D. 15

Correct answer: C. 18

Each row index appears three times and each column index appears three times, so the total is 3 x (0+1+2) x 2 = 18.

More C Programming questions

Exams that ask this topic