AboutPrince M. Premnath Expertise Years of research in Turbo C 3.0 Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Be free to ask questions.
Expert: Prince M. Premnath Date: 4/18/2008 Subject: matrix multiplication
Question
Hello
i have the following question
how can i multiply 2 matrices?
the rules are the following
assume that A and B are matrices
the result will go into matrix C
number of columns in A same as rows in B
rows in C = rows in A
columns in C = columns in B
i've been struggling a lot to write such algorithm
but never found the right solution
thanks
Answer Hi Dear John .K
Your Problem is all about to multiply a square matrix , say number of rows equal to number of columns ,
Here im presenting a sample code to multiply two matrix a , b and the result will be stored in matrix C
#include<iostream.h>
void main()
{
int a[3][3] , b[3][3] , c[3][3];