HOw to do matrix??????????

for example, if i want to perform matrix multiplication over 2x2
matrices:
( a1 b1 ) x ( a2 b2 ) = ( a b )
( c1 d1 ) ( c2 d2 ) ( c d )
where
- a = a1*a2 + b1*c2
- b = a1*b2 + b1*d2
- c = c1*a2 + d1*c2
- d = c1*b2 + d1*d2

and this is the out come i want.
This program performs matrix multiplication over two 2x2 matrices.
Give me the elements of the first matrix separated by space: 1 2 3 4
Give me the elements of the second matrix separated by space: 2 3 4 5
The resulting matrix is:
( 10 13 )
( 22 29 )

how to write then>>>?>>>??
Last edited on
Hmmm... homework question?

You have all the code in front of your nose you just have to translate it to C++.

Hint: Look at the format of the input
<#><space><#><space><#><space><#>

cin >> # >> #...

Then just calculate the answers using the formula you posted above.
hi... how to make a C++ matrix??that has a multiplication and addition matrix??
that has two arrays and in evry arrays has a 2 col and 2 rows. thanks... plz help me.
Topic archived. No new replies allowed.