ProgrammingVery hard
The sum of the elements of a[i][j] = i * j over the 4 x 4 matrix equals what?
- A. 30
- B. 36
- C. 40
- D. 16
Correct answer: B. 36
The sum is (0 + 1 + 2 + 3) x (0 + 1 + 2 + 3) = 6 x 6 = 36, since the double sum factors.
More C Programming questions
- Which statement about matrix multiplication in C is correct for an m x k matrix times a k x n matrix?
- Sum of a 2 x 2 window of m[i][j] = i + j starting at (1,1) in a 4 x 4 grid, i.e. m[1][1] + m[1][2] + m[2][1] + m[2][2]. What is the value?
- In a 2D array with int a[5][5], what is the total number of bytes in one row when int is 4 bytes?
- What is the most efficient way to check whether an n x n matrix is symmetric in O(n^2)?
- 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)?
- The number of ways to tile a 2 x 5 board exactly with 2 x 1 dominoes, counting orientations, is what?