Two dimensional array

Syntax: data-type    array-name[row][column];

Example:

The memory space can be imagined as follows:

mat[0][0]
mat[0][1]
mat[0][2]
mat[0][3]
mat[1][0]
mat[1][1]
mat[1][2]
mat[1][3]
mat[2][0]
mat[2][1]
mat[2][2]
mat[2][3]

Code example: Write a c program to input a 3×3 matrix And show the matrix.

OUTPUT

Enter element of 3X3 matrix:
1 2 4
5 6 3
7 9 8
The given matrix is :
1 2 4
5 6 3
7 9 8


Next Previous