--:--









Quiz for Multi-dimensional arrays

Course: C Language | Subject: Unit 5 | Topic: Arrays and Strings



Logo

Q1: What is the correct way to declare a two-dimensional array in C?

Logo

Q2: If int arr[3][4]; is declared, how many elements does it have?

Logo

Q3: Which is the valid initialization for int arr[2][2]?

Logo

Q4: What is the index of element 5 in arr[2][3] if stored in row-major order?

Logo

Q5: What will sizeof(int[3][5]) return if int is 4 bytes?

Logo

Q6: How are multi-dimensional arrays stored in memory in C?

Logo

Q7: What is the base address of arr[3][4] in memory?

Logo

Q8: Which syntax correctly accesses the element in 2nd row, 3rd column of arr[4][4]?

Logo

Q9: What happens if you access arr[3][5] in int arr[3][5]?

Logo

Q10: Which function parameter is correct for a 2D int array with 3 columns?

Logo

Q11: What is printed by printf("%d", arr[1][2]); if arr={{1,2,3},{4,5,6}}?

Logo

Q12: Which is a valid 3D array declaration?

Logo

Q13: If int arr[2][3] = {{1,2,3},{4,5,6}}, what is arr[0][1]?

Logo

Q14: Which loop correctly traverses a 2D array arr[3][3]?

Logo

Q15: If int arr[2][3] is declared but not initialized, what are the values?

Logo

Q16: Which statement is true about multi-dimensional arrays?

Logo

Q17: If int arr[2][2] = {{1},{3}}, what is arr[0][1]?

Logo

Q18: Which is NOT a valid operation on a 2D array?

Logo

Q19: If int arr[3][3], what is *(arr[1] + 2)?

Logo

Q20: Which access is equivalent to *(*(arr + i) + j)?

Are you ready to start test? Set your time limit