Learn with Yasir

Share Your Feedback

12. Quick Knowledge Check


12. Quick Knowledge Check

Test your understanding

0 / 5 answered

Q1. What does a two-dimensional array store?

A. Only one value

B. Values in rows and columns

C. Different data types in one element

D. Only characters

Check answer

Q2. What is the first element of int arr[3][4]?

A. arr[1][1]

B. arr[0][1]

C. arr[0][0]

D. arr[3][4]

Check answer

Q3. How many elements are present in int arr[3][4]?

A. 7

B. 12

C. 16

D. 9

Check answer

Q4. Which loop controls the rows in the usual nested-loop approach?

A. Inner loop

B. Outer loop

C. Both always control columns

D. Neither

Check answer

Q5. What does arr[1][2] represent?

A. First row, second column

B. Second row, third column

C. Third row, second column

D. Second row, second column

Check answer

Reset knowledge check

13. Lesson Summary

In this lesson, we learned:

  • What two-dimensional arrays are and why they are useful.
  • How to declare and initialize 2D arrays.
  • How to access individual elements using row and column indexes.
  • How to use nested loops to input and display array elements.
  • How to solve real-world problems using 2D arrays.