im tryin to add a matrix array and it should look like this:
1 2 3 2 4 6 3 6 9
4 5 6 + 2 2 3 = 6 7 9
1 2 3 3 7 1 4 9 4
heres what i have done so far, i just cant get that "+" and "=" sign in there...
#include <iostream>
using namespace std;
int main()
{
int myArray[3][3] = {{1,2,3},{4,5,6},{1,2,3}};
int bArray[3][3] = {{2,4,6},{2,2,3},{3,7,1}};
for (int row = 0; row < 3; row++)
{
for(int column = 0; column < 3; column++)
{
cout << myArray[row][column] << " ";
cout << bArray[row][column] << " ";
cout << myArray[row][column] + bArray[row][column]<< " ";
}
cout << endl;
}
return 0;
}
Last edited on