48. C Program To Display 9 numbers in 3X3 matrix order.
How does this program work?
- This program is used to print the given 9 numbers into 3X3 structure.
Here is the code
#include <stdio.h>
int main(void)
{
int arr1[3][3],i,j;
// Enter values into the array
printf("Input elements to the matrix :\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("element - [%d],[%d] : ",i,j);
scanf("%d",&arr1[i][j]);
}
}
printf("\nThe matrix is : \n");
for(i=0;i<3;i++)
{
printf("\n");
for(j=0;j<3;j++)
printf("%d\t",arr1[i][j]);
}
printf("\n\n");
return 0;
}