To multiply two matrices we need to first check whether the two matrices can be multiplied or not. For that compare the first matrix column with the rows of second matrix, if they are equal than only the two matrices can be multiplied with each other.