#include<stdio.h>
#include<stdlib.h>
void main()
{
int **ap,**bp,**cp,sum=0;
int m,n,i,j,k;
printf("\nEnter m and n for mXn matrix :");
scanf("%d%d",&m,&n);
ap=(int**)malloc(sizeof(int)*m);
for(i=0;i<n;i++)
ap[i]=(int*)malloc(n*sizeof(int));
bp=(int**)malloc(sizeof(int)*m);
for(i=0;i<n;i++)
bp[i]=(int*)malloc(sizeof(int)*n);
cp=(int**)malloc(sizeof(int)*m);
for(i=0;i<n;i++)
cp[i]=(int*)malloc(sizeof(int)*n);
printf("\nEnter %d elements of matrix A :",m*n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("%d",&ap[i][j]);
}
printf("\nEnter %d elements of matrix B :",m*n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("%d",&bp[i][j]);
}
printf("\nMatrix A :\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t",ap[i][j]);
}
printf("\n");
}
Designed By Blogger Templates | Templatelib & Distributed By Blogspot Templates