+ 1
Matrices on c++
How do I add two 2 by 2 matrices using for loops and even transform them?
3 odpowiedzi
+ 3
You just iterate through the matrices(m1,m2) and store the sum in the new matrix sum
for(int i=0;i<2;i++){
for(int j=0;j<2;j++){
sum[i][j]=m1[i][j]+m2[i][j];
cout<<sum[i][j]<<“ “;
}
}
0
int matrice[2][2] = blah blah blah
0
I have a code for multiplying matrices in c#. Take a look in my profile, it will help you.