diff --git a/Maths/Matrix-Calculator.cpp b/Maths/Matrix-Calculator.cpp new file mode 100644 index 00000000..d44d2ba2 --- /dev/null +++ b/Maths/Matrix-Calculator.cpp @@ -0,0 +1,85 @@ +#include +#include +#include + +int main() +{ clrscr(); + int arr1[20][20],arr2[10][10]; + int result[20][20]; + int m,n; + int i,j; + // prompts the user to enter the rows and columns of the matrix + cout<<" Enter the number of rows (m) : "; + cin>>m; + cout<<" Enter the number of columns (n) : "; + cin>>n; + cout<<" \n Enter the elements of the 1st matrix \n "; + + for (i=0; i "; + cin>>arr1[i][j]; + } + } + + cout<<"\n Enter the elements of the 2nd matrix : \n "; + for (i=0; i "; + cin>>arr2[i][j]; + } + } + + //------------ display matrics ----------------------- + + cout<<"\n 1st matrix \n "; + for (i=0; i