C++ program for addition and subtraction of two matrices
kw.cpp
Output
kodingwindow@kw:~$ g++ kw.cpp
kodingwindow@kw:~$ ./a.out ——————————————————————————————————————————— Program for addition and subtraction of matrices ——————————————————————————————————————————— Enter the number of row(s) 2 Enter the number of column(s) 2 Enter elements for matrix A [1][1]=5 [1][2]=5 [2][1]=6 [2][2]=6 Enter elements for matrix B [1][1]=6 [1][2]=6 [2][1]=5 [2][2]=5 Matrix A is 5 5 6 6 Matrix B is 6 6 5 5 The addition of matrix A and matrix B is 11 11 11 11 The subtraction of matrix A and matrix B is -1 -1 1 1 ——————————————————————————————————————————— kodingwindow@kw:~$
What Next?
C++ Classes
Advertisement