+ 1
please can someone help me with the logic of matrix multiplication of array 2*2
6 Respuestas
+ 4
Do you have a code in development? link the code here so people can help you with the logic issue :)
0
/*
Mul of array
*/
#include<iostream>
using namespace std;
int main()
{
int m, n, c, d, first[][], second[][], mul[][];
cout << "Enter the number of rows and columns of matrix : ";
cin >> m >> n;
cout << "Enter the elements of first matrix : \n";
for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ )
cin >> first[c][d];
cout << "Enter the elements of second matrix : \n";
for ( c = 0 ; c < m ;c++ )
for ( d = 0 ; d < n ; d++ )
cin >> second[c][d];
for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ )
mul[c][d] = first[c][d] * second[c][d];
cout << "Mul of entered matrices:-\n";
for ( c = 0 ; c < m ; c++ )
{
for ( d = 0 ; d < n ; d++ )
cout << mul[c][d] << "\t";
cout << endl;
}
return 0;
}
0
I’m pretty sure this is c++ you might want to tag it as that, so that you can find some c++ programmers to help👌
0
Thanks everyone
0
But the code above i think its just multiplication of the values of arrays with corresponding address
0
I need the logic of the multiplication we do in matrix