• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
August 16, 2022 |3.1K Views
Java Program to Multiply Two Matrices of any Size
  Share   Like
Description
Discussion

In this video, we will see how to write a Java program to multiply two matrices of any size.

To multiply two matrices of any size, we take the elements as user input using the Scanner class.

We need to make sure, that the two matrix sizes satisfy the necessary conditions for matrix multiplication. 
Then, we need to iterate on the matrices using for-loops and keep storing the resultant elements into a new 2-d array. 
Finally, we print the array to get the resultant matrix, which stores the result of the matrix multiplication.

 Java Program to Multiply two Matrices of any size
https://www.geeksforgeeks.org/java-program-to-multiply-two-matrices-of-any-size/

Read More