1. : What is a multi-dimensional array?
(A) An array with one dimension
(B) An array with more than one dimension
(C) A single value
(D) A collection of strings
2. : How do you declare a two-dimensional array in C?
(A) int array[];
(B) int array[10][10];
(C) int array[10];
(D) int array[10, 10];
3. : How is a two-dimensional array stored in memory?
(A) As a single contiguous block of memory
(B) As linked lists
(C) As separate arrays
(D) Randomly in memory
4. : What is the index of the first element in a two-dimensional array in C?
(A) [0][0]
(B) [1][1]
(C) [1][0]
(D) [0][1]
5. : How do you access the element in the 3rd row and 2nd column of a two-dimensional array in Java?
(A) array[2][1]
(B) array[3][2]
(C) array[1][2]
(D) array[2][3]
6. : What is the time complexity of accessing an element in a multi-dimensional array?
(A) O(n)
(B) O(log n)
(C) O(1)
(D) O(n^2)
7. : How do you initialize a three-dimensional array in C++ with zeros?
(A) int array[3][3][3] = {0};
(B) int array[3][3][3] = 0;
(C) int array[3][3][3];
(D) int array[3][3][3] = { {0} };
8. : Which of the following correctly initializes a two-dimensional array in Python?
(A) array = [[0 for x in range(5)] for y in range(5)]
(B) array = [0][0]
(C) array = [0 for x in range(5)][0 for y in range(5)]
(D) array = [[0]*5]*5
9. : What is the output of the following code in Python? array = [[1, 2], [3, 4]]; print(array[1][0])
(A) 1
(B) 2
(C) 3
(D) 4
10. : Which of the following is a correct way to declare a multi-dimensional array in JavaScript?
(A) var array = [[1, 2], [3, 4]];
(B) var array = {1, 2, 3, 4};
(C) var array = [[1, 2, 3, 4]];
(D) var array = [1, [2, 3], 4];
11. : What is the default value of elements in a multi-dimensional array of integers in Java?
(A) 0
(B) null
(C) undefined
(D) random garbage value
12. : How do you find the total number of elements in a two-dimensional array int array[3][4]; in C++?
(A) 3 + 4
(B) 3 * 4
(C) sizeof(array)
(D) sizeof(array) / sizeof(array[0][0])
13. : Which function would you use to find the number of rows in a two-dimensional array arr in Python?
(A) len(arr)
(B) len(arr[0])
(C) size(arr)
(D) count(arr)
14. : How do you iterate through all elements of a two-dimensional array in Java?
(A) Using nested for loops
(B) Using a single for loop
(C) Using a while loop
(D) Using the array’s length property
15. : What is the result of the following code? int array[2][2] = {{1, 2}, {3, 4}}; printf(“%d”, array[1][1]);
(A) 1
(B) 2
(C) 3
(D) 4
16. : How do you declare a two-dimensional array with 3 rows and 4 columns in Java?
(A) int[][] array = new int[3][4];
(B) int[] array = new int[3][4];
(C) int[][] array = new int[4][3];
(D) int array[][] = new int[3][4];
17. : Which of the following is a valid way to assign a value to an element in a three-dimensional array in C++?
(A) array[1][2] = 10;
(B) array[1][2][3] = 10;
(C) array[1, 2, 3] = 10;
(D) array[1][2][3][4] = 10;
18. : How do you access the element in the 2nd row and 3rd column of a two-dimensional array in C++?
(A) array[3][2]
(B) array[2][3]
(C) array[2][2]
(D) array[1][2]
19. : What is the output of the following code in C++? int array[2][2] = {{1, 2}, {3, 4}}; cout << array[0][1];
(A) 1
(B) 2
(C) 3
(D) 4
20. : How do you pass a multi-dimensional array to a function in C?
(A) void function(int array[10][10]);
(B) void function(int array[][]);
(C) void function(int array);
(D) void function(int *array);