Lesson 13 of 23

2D Arrays: Matrices

11 min 30 XP

int m[3][3] ಎಂದರೆ 3 rows ಮತ್ತು 3 columns ಇರುವ ಕೋಷ್ಟಕ, m[i][j] ಎಂದು ಬಳಸುತ್ತೇವೆ. ಎರಡು nested loops ಅದನ್ನು ಓದಿ print ಮಾಡುತ್ತವೆ.

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

Matrix ಗುಣಾಕಾರ: C[i][j] = Σ A[i][k] × B[k][j], ಮೂರು nested loops. ಜನಪ್ರಿಯ interview ಪ್ರೋಗ್ರಾಮ್.

Challenge

+30 XP

n ಮತ್ತು ಒಂದು n × n matrix ಓದಿ. ಪ್ರತಿ ಕರ್ಣದ ಮೊತ್ತವನ್ನು print ಮಾಡಿ. Input: 3 1 2 3 4 5 6 7 8 9 Output: Main: 15 Other: 15

Output Loading C (first time takes a few seconds)
Press Run to see the result here.