matrix operations in c

matrix multiplication:

To multiply two matrixes sufficient and necessary condition is “number of columns in matrix A = number of rows in matrix B”.
Loop for each row in matrix A.
Loop for each columns in matrix B and initialize output matrix C to 0. This loop will run for each rows of matrix A.
Loop for each columns in matrix A.
Multiply A[i,k] to B[k,j] and add this value to C[i,j]
Return output matrix C.

PROGRAM FOR MATRIX MULTIPLICATION

matrix addition:

To add two matrixes sufficient and necessary condition is “dimensions of matrix A = dimensions of matrix B”.
Loop for number of rows in matrix A.
Loop for number of columns in matrix A.
Input A[i,j] and Input B[i,j] then add A[i,j] and B[i,j]
store and display this value as C[i,j];

PROGRAM FOR MATRIX ADDITION

Latest posts by admin (see all)

More in sem1
matrix addition in c

matrix addition in c PROGRAM: #include<stdio.h> #include<conio.h> int main() {  int mata[3][3],matb[3][3],matc[3][3];  int r,c,k;  for(r=0; r<3; r++)  {   for(c=0; c<3;...

Close