2d array programs

C++ program to show addition and subtraction of two matrix

Addition and subtraction of two matrix

These two programs illustrate the concept addition and subtraction of two matrix.

  • Here in this program “i” is number of rows and “j” is number of coloumns.
  • “a[3][3]” is the name of first array with 3 rows and 3 coloumns .
  • “b[3][3]” is the name of second array with 3 rows and 3 coloumns .
  • “c[3][3]” is the name of resultant array with 3 rows and 3 coloumns .In this array result will be stored.

Addition of two matrix

OUTPUT

addition and subtraction of two matrix


Subtraction of two matrix

addition and subtraction of two matrix


Comment below if you are facing any problem


Also read

C++ simple program to enter 3 x 3 matrix
C program to multiply two matrix
How to add two Matrices in c program