## c program Perform matrix operation,c program to perform matrix multiplication using recursion,c program to perform matrix multiplication using functions,c program to perform matrix addition,c program to perform matrix addition using pointers,c program for matrix transpose,c program for matrix multiplication 2x2,c program for matrix chain multiplication,c program for matrix multiplication using divide and conquer

#include"stdio.h"
#include"conio.h"
void main()
{
clrscr();
printf("\nHow many row in first matrix=");
scanf("%d",&r1);
printf("\nHow many column in first matrix=");
scanf("%d",&c1);
printf("\n\nEnter the element in first matrix=\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
{
scanf("%d",&mat1[i][j]);
}
}
printf("\n\nHow many row in second  matrix=");
scanf("%d",&r2);
printf("\nHow many cloumn in second matrix=");
scanf("%d",&c2);
printf("\n\nEnter the element in second matrix=\n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
{
scanf("%d",&mat2[i][j]);
}
}
printf("\n\nFirst array is=\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
{
printf("%4d",mat1[i][j]);
}
printf("\n");
}
printf("\n\nSecond array is=\n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
{
printf("%4d",mat2[i][j]);
}
printf("\n");
}
if(r1==r2&&c1==c2)
{
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
{
sub[i][j]=mat1[i][j]-mat2[i][j];
}
}
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
{
}
printf("\n");
}
printf("\n\nSubstraction of matrix is=\n\n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
{
printf("%4d",sub[i][j]);
}
printf("\n");
}
}
else
{
printf("\n\nAddition of matrix is not possible.");
printf("\n\nSubstraction of matrix is not possible.");
}
if(c1==r2)
{
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
{
mult[i][j]=0;
for(k=0;k<r2;k++)
{
mult[i][j]=mult[i][j]+mat1[i][k]*mat2[k][j];
}
}
}
printf("\n\nMultiplication of matrix is=\n\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
{
printf("%4d",mult[i][j]);
}
printf("\n");
}
}
else
{
printf("\n\nMultiplication of matrix is not possible.");
}
getch();
}