JAVA-Record-02)AIM: Write a Java program to calculate multiplication of 2 matrices.
02)AIM:
Write a Java program to calculate multiplication of 2 matrices.
Matrix Multiplication Algorithm:
- Start
- Declare variables and initialize necessary variables
- Enter the element of matrices by row wise using loops
- Check the number of rows and column of first and second matrices
- If number of rows of first matrix is equal to the number of columns of second matrix, go to step 6. Otherwise, print matrix multiplication is not possible and go to step 3.
- Multiply the matrices using nested loops.
- Print the product in matrix form as console output.
- Stop
Flow chart:
Code:02
Output:01
Output:02
Comments
Post a Comment