Matrix Multiplication in C

Here is the program for matrix multiplication in C.

m and n are rows and columns of first matrix.

p and q are rows and columns of second matrix.

Then, multiplication is possible only if n==p.

 

Matrix Multiplication in C

 

Output

Enter rows and columns of first matrix:3
3
Enter rows and columns of second matrix:3
3

Enter first matrix:
1 2 3
4 5 6
7 8 9

Enter second matrix:
9 8 7
6 5 4
3 2 1

The new matrix is:
30 24 18
84 69 54
138 114 90

 

Comment below if you have any doubts related to above program for matrix multiplication in C

" data-link="https://twitter.com/intent/tweet?text=Matrix+Multiplication+in+C&url=https%3A%2F%2Fwww.thecrazyprogrammer.com%2F2012%2F09%2Fc-program-to-multiply-two-matrices_26.html&via=">">Tweet
2 Shares

3 thoughts on “Matrix Multiplication in C

  1. NIYIN SINGH

    HI .
    I am preparing for january ‘o’ level examination.
    will you give me some important tips .
    to qualified examination.

    Reply
  2. Saranya.Madhavan

    Really thankful to you….This site helped me in preparing for university exam ………thank you a lot…..

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.