Program to display 2D Array Elements in C programming
#include<stdio.h>
#include<conio.h>
main()
{
int i,j,mat[3][3];
printf("enter the elements of 3x3 matrix\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&mat[i][j]);
}
}
printf("The elements of 3x3 matrix are :\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d\t",mat[i][j]);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment