New course! Every coder should learn Generative AI!
Try a free lesson0
How can i add two matrics using array in c++
3 Answers
+ 1
Thanks
0
2D array right??
0
for 2D array
let r and c be the rows and coloumn of the two matrix i.e 'a 'and 'b '....then the resulting array be 'c' be of the order r ×c
the logic part:
for(i=0;i<r;i++)
{for(j=0;j<c;j++)
{
c[i][j]=a[i][j]+b[i][j];
}
}