C Program to Multiply two Matrices by Passing Matrix to a Function

In this example, you’ll learn to multiply two matrices and display it using user defined function.

This program asks the user to enter the size of the matrix (rows and column).

Then, it asks the user to enter the elements of those matrices and finally adds and displays the result.

 

To perform this task three functions are made:

  1. To takes matrix elements from user enterData()
  2. To multiply two matrix multiplyMatrices()
  3. To display the resultant matrix after multiplication display()

Example: Multiply Matrices by Passing it to a Function