ProgrammingHard

For a 4 x 4 matrix with a[i][j] = 4i + j, what is the sum of the anti-diagonal cells (i, 3 - i)?

  1. A. 34
  2. B. 28
  3. C. 30
  4. D. 36

Correct answer: C. 30

The cells are 3, 6, 9 and 12, which sum to 30. Summing the main diagonal would give 34 instead.

More C Programming questions

Exams that ask this topic