Home » Matrix multiplication in C

Matrix multiplication in C

by Online Tutorials Library

Matrix multiplication in C

Matrix multiplication in C: We can add, subtract, multiply and divide 2 matrices. To do so, we are taking input from the user for row number, column number, first matrix elements and second matrix elements. Then we are performing multiplication on the matrices entered by the user.

In matrix multiplication first matrix one row element is multiplied by second matrix all column elements.

Let’s try to understand the matrix multiplication of 2*2 and 3*3 matrices by the figure given below:

matrix multiplication program in c

Let’s see the program of matrix multiplication in C.

Output:

enter the number of row=3 enter the number of column=3 enter the first matrix element= 1 1 1 2 2 2 3 3 3 enter the second matrix element= 1 1 1 2 2 2 3 3 3 multiply of the matrix= 6 6 6 12 12 12 18 18 18 

Let’s try to understand the matrix multiplication of 3*3 and 3*3 matrices by the figure given below:

matrix multiplication in c


You may also like