C Program for MATRIX MULTIPLICATION..

Program by :-> JAYANT PUROHIT

This Program is illustrates the multiplication of two matrix.
It is a generalized program which accepts the values of matrix from users.
The code is  as follow:->

 
#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],r,d;
clrscr();
for(r=0;r<3;r++)
{
for(d=0;d<3;d++)
{
printf("\n Please enter the value of matrix A of position :- ");
scanf("%d",&a[r][d]);
}
}
for(r=0;r<3;r++)
{
for(d=0;d<3;d++)
{
printf("\n Please enter the value of matrix B of position :- ");
scanf("%d",&b[r][d]);
}
}

for(r=0;r<3;r++)
{
for(d=0;d<3;d++)
{
c[r][d]=a[r][0]*b[0][d]+a[r][1]*b[1][d]+a[r][2]*b[2][d];
}
}
printf("\n The Matrix Obtained By Multiplication of Feeded Two Matrix is :->");
for(d=0;d<3;d++)
{
printf("\n\n %d    %d    %d",c[d][0],c[d][1],c[d][2]);
}
getch();
}


The Output of the above program is as follow:-





If u r satisfied by this program then do not forget to comment and post your reviews.
you may also contect me on jforjaxi@yahoo.com 


2 comments:

  1. sir,
    I am palak gagrani,bca 1st year,
    I am not getting the prime number pprogram so please send it to me on "palakg21@gmail.com"

    ReplyDelete

Please write your Views about this Post here:->;

Pageviews last month