Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the declaration for a two-dimensional array with 3 rows and 4 columns?
Think of the format data_type array_name[num_rows][num_columns];
How would you access the first element in a 2D array called 'data'?
Remember, array indexing starts at 0.
What will int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}}; do?
Consider both declaration and initialization parts.
Can a two-dimensional array be accessed in a single index?
Think about how index locations work in arrays.
Write a C++ program that calculates the average of all elements in a 3x3 matrix.
Don’t forget to initialize your sum variable at 0!
Create a program that takes two 2D arrays, multiplies them, and outputs the resulting matrix.
Ensure to remember the logic that only certain dimensions can be multiplied together.
5 more questions in this section. Enroll free to practise them all.
Enroll free