can someone help mi out with how to write a simple(2X2) matrix....I need help only with the loop used..... I got a wrong answer with what i got below
const int Row = 2;
const int Col = 2;
int main()
{
int MatrixA[Row][Col] = {1,2,3,2};
int MatrixB[Row][Col] = {1,1,2,1};
int MatrixC[Row][Col] = {0};
for(int i = 0; i < Row ; i++)
{
for(int j = 0; j < Col; j++){
MatrixC[i][j] = (MatrixA[i][j] * MatrixB[i][j]) + (MatrixA[i][j+1] * MatrixB[i+1][j]);
cout<<MatrixC[i][j];
}
cout<<endl;
}
system("PAUSE");
return 0;
}
:)