Anonymous

Can You Write A Program To Read Matrix M*n On The Keyboard And Display The Same?

1

1 Answers

Anonymous Profile
Anonymous answered
#include<conio.h>
#include<stdio.h>
void main()
{
int a[10][10],m,n,I,j;
clrscr();
printf("Enter the number of rows in the matrix:");
scanf("%d",&m);
printf("Enter the number of columns in the matrix:");
scanf("%d",&n);
for(I=0;I<m;I++)
for(j=0;j<n;j++)
scanf("%d",&a[I][j]);
printf("The matrix is as follows");
for(I=0;I<m;I++)
{

for(j=0;j<n;j++) printf("%d ",a[I][j]);
printf("/n");
}
getch();
}

Answer Question

Anonymous