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, with three rows and three 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

Cwassignments programming help is a website that provides students with all the materials they need to complete their programming assignments successfully. The website offers a range of resources, including tutorials, examples, and a forum where students can ask for help

1 COMMENT

LEAVE A REPLY