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.