//Matrix Development
in C
#include<stdio.h>
#include<conio.h>
#include<math.h>
void
main()
{
int
i,j,m,n,a[10][10];
clrscr();
printf("Number
of Rows\n");
scanf("%d",&m);
printf("Number
of Columns\n");
scanf("%d",&n);
//Entry of elements of the matrix
printf("Enter
the elements\n");
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
scanf("%d",&a[i][j]);
}
}
//Displaying the matrix
printf("The
matrix with %d rows and %d cols is\n",m,n);
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n\n");
}
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.