ProgrammingHard

A 3 x 4 matrix holds a[i][j] = i * 4 + j + 1. What is the sum of its boundary cells (first and last row, first and last column)?

  1. A. 60
  2. B. 70
  3. C. 65
  4. D. 54

Correct answer: C. 65

The top row sums to 10, the bottom row to 42, and the two middle-row boundary cells are 5 and 8. 10 + 42 + 5 + 8 = 65.

More C Programming questions

Exams that ask this topic