Java program to add two matrices

In this post, we will see how to add two matrices in java.I am giving example for 33 matrix. You can extend it to nn matrices.

Output:

Enter matrix 1 elements : 11 22 33 44 55 66 77 88 99
Enter matrix 2 elements : 10 20 30 40 50 60 70 80 90
The new matrix is :
21 42 63
84 105 126
147 168 189

That’s all about adding two matrices.

Was this post helpful?

Leave a Reply

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