Interactive Quiz for Chapter 8

 Question Your Answer Result/Explanation 8.1 Write a statement to declare a variable named x for a two dimensional array of double values with row size 3 and column size 4. 8.2 Declare a two-dimensional array x of the int type with 40 rows and 20 columns. 8.3 Suppose int m[][3] = {{4, 5, 6}, {2, 1, 0}}, what is m[0][1]? 8.4 Suppose int m[][3] = {{4, 5, 6}, {2, 1, 0}}, what is m[1][0]? 8.5 Suppose int m[][3] = {{4, 5, 6}, {2, 1, 0}}, what is m[0][2]? 8.6 What is the output of the following code? ``` int f(int m[][3], int rowSize) { int result = 0; for (int i = 0; i < rowSize; i++) for (int j = 0; j < 3; j++) result += m[i][j]; return result; } int main() { int x[][3] = { { 1, 2, 1 }, { 1, 1, 1 } }; cout << f(x, 2); return 0; } ``` 8.7 What is the output of the following code? ``` int m(int m[][3], int rowSize) { int result = m[0][1]; for (int i = 0; i < rowSize; i++) for (int j = 0; j < 3; j++) if (result < m[i][j]) result = m[i][j]; return result; } int main() { int x[][3] = {{2, 1, 1}, {1, 7, 1}}; cout << m(x, 2); return 0; } ```