Program No : 32 :

Write a program in C to print the product of two M x N Matrix ?

program no  :  32
purpose : product of two  M x N matrix.

#include<"stdio.h">
#include<"conio.h">

main ()
{
	
	int a[10][10],b[10][10],res[10][10];

	int row1,col1, row2, col2;

	printf("Enter row and column Size of matrix one\n");

	scanf("%d%d", &row1,&col1);

	
	printf("Enter row and column Size of matrix second\n");

	scanf("%d%d", &row2,&col2);


	if(col1!=row2)
	{
		printf("Row and Column sizes does not match for product");
		getch();
		return 0;
	}

	printf("\nEnter %d x %d Matrix 1 \n",row1,col1);

	readmatrix(a,row1,col1);

	printf("\nEnter %d x %d Matrix 2 \n",row2,col2);

	readmatrix(b,row2,col2);

	prooftwo(a,b,res,row1,col1,row2,col2);

	printf("output Matrix\n");

	printmatrix(res,row1,col2);

	getch();

}

readmatrix(m,row,col)
int m[][10], row,col;
{
	int i, j;

	for(i=0;i
}  
Back