ProgrammingHard

In the 3 x 3 matrix [[1,2,3],[4,5,6],[7,8,9]], what is the sum of the boundary cells, leaving the centre out?

  1. A. 45
  2. B. 40
  3. C. 41
  4. D. 37

Correct answer: B. 40

The boundary cells are 1, 2, 3, 6, 9, 8, 7, 4 and their sum is 40. The centre 5 is excluded.

More C Programming questions

Exams that ask this topic