Lesson 13 of 23
2D Arrays: Matrices
11 min 30 XP
int m[3][3] is a table with 3 rows and 3 columns, accessed as m[i][j]. Two nested loops read and print it.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.Matrix multiplication: C[i][j] = Σ A[i][k] × B[k][j], three nested loops. A popular interview program.