codinasion-archive / codinasion-programme

An open source codebase for sharing programming solutions.
https://codinasion.vercel.app/programme
MIT License
62 stars 147 forks source link

Matrix Multiplication #170

Closed harshraj8843 closed 2 years ago

harshraj8843 commented 2 years ago

Title of article

Write a Java program to print multiplication of 2 matrices.

Additional information

First matrix

1  1  1
2  2  2 
3  3  3 

Second matrix

1  1  1
2  2  2 
3  3  3 

Product matrix

6  6  6
12 12 12
18 18 18

Code of Conduct

Anzo52 commented 2 years ago

@harshraj8843 What kind of input were you expecting? Six lines of space-separated ints? Or should there be a Sys out like:

Enter first matrix...
Line 1:
Line 2:
Line 3:

?

harshraj8843 commented 2 years ago

@harshraj8843 What kind of input were you expecting? Six lines of space-separated ints? Or should there be a Sys out like:

Enter first matrix...
Line 1:
Line 2:
Line 3:

?

Well, in this case input is complex. So, we can use static input (hard coded variables)

Anzo52 commented 2 years ago

@harshraj8843 What kind of input were you expecting? Six lines of space-separated ints? Or should there be a Sys out like:

Enter first matrix...
Line 1:
Line 2:
Line 3:

?

Well, in this case input is complex. So, we can use static input (hard coded variables)

I see. 👍 Is there supposed to be a multiplier as well?

harshraj8843 commented 2 years ago

Is there supposed to be a multiplier as well?

Yes

Anzo52 commented 2 years ago

I've got a method ready for this one, just need to clean up output. Assuming you want the first two arrays/matrices printed along with result?