What does the following code snippet do?
int a[3][3]; // declare 2D array
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
if (i == j) a[i][j] = 1;
}
}
a) Initializes a 2D array with ones on the diagonal
b) Initializes a 2D array with zeros on the diagonal
c) Sets all elements of the array to 1
d) Generates a compilation error