void input_matrix(int[][],int,int);
void output_matrix(int[][],int,int);
void multiply(int[][],int[][],int[][],int,int,int);
main()
{
int mat1[100][100],mat2[100][100],mat3[100][100];
int m,n,l;
char ch;
do
{
clrscr();
printf("\nEnter the no.of rows and columns of 1st matrix:-\n");
scanf("%d %d",&m,&n);
input_matrix(a,m,n);
out_matrix(a,m,n);
printf("\nEnter the no.of rows and columns of 2nd matrix:-\n");
scanf("%d %d",&n,&l);
input_matrix(b,n,l);
out_matrix(b,n,l);
multiply(a,b,c,m,n,l);
printf("\n Do you want to continue?(Y=yes,N=No)\n");
ch=getch();
}
while(ch=='y' || ch== 'Y');
getch();
}
void input_matrix(int a[100],int m,int n)
{
int i,j;
printf("\n Enter the elements of the matrix:-\n");
for(i=0;i
}
}
void output_matrix(int a[100],int m,int n)
{
int i,j;
printf("\n Your entered matrix is:-\n");
for(i=0;i
printf("\n");
}
}
void multiply(int a[100],int b[100][100], int c[100][100],int m,int n,int l)
{
int i,j,k;
for(i=0;i
for(k=0;k
}
}
No comments:
Post a Comment