C program to create and print 3×3 matrix

A matrix is a multi-dimensional array of elements.

3×3 matrix means a matrix of order 3, that is, having 3 rows and 3 columns.

#include<stdio.h>
int main(){
int a[3][3],i,j;
for(i=0;i<3;i++)
for(j=0;j<3;j++){
printf("Enter Element at %d%d position",i+1,j+1);
scanf("%d",&a[i][j]);

}
for(i=0;i<3;i++){
for(j=0;j<3;j++){
printf(" %d ",a[i][j]);
}
printf("\n");

}
return 0;

}

 

Output