I need to make program that calculate multiplication of matrice
i made it in main now i need to make it in functions would anybody hepl me with my problem
that is my code
#include <iostream>
using namespace std;
#include <cstdlib>
void fn(int **arr) {
}
void fn2 (int **arr2){
}
void fn3 (int **arr3){
}
int main() {
int r, c ,r2 , c2 , r3 , c3 ;
cout << "Enter size of row 1 : " ;
cin >> r ;
cout << "Enter size of column 1 : " ;
cin >> c ;
cout << "Enter size of row 2 : " ;
cin >> r2 ;
cout << "Enter size of column2 : " ;
cin >> c2 ;
cout << "Enter matrix 2 please " ;
if (c != r2)
cout << "The dimensions are not valid " << endl ;
else {
int **arr = new int*[r];
for (int i = 0; i < r; i++)
arr[i] = new int[c] ;
cout << "Enter matrix 1 please " ;
for (int i=0 ; i<r ; i++){
for (int j=0 ; j<c ; j++)
cin >> arr[i][j] ;
}
for (int i=0 ; i<r ; i++){
for (int j=0 ; j<c ; j++)
cout << arr[i][j]<<" " ;
cout << endl ;
}
int **arr2 = new int*[r2];
for (int i = 0; i < r2 ; i++)
arr2[i] = new int[c2] ;
cout << "Enter matrix 2 please " ;
for (int i=0 ; i<r2 ; i++){
for (int j=0 ; j<c2 ; j++)
cin >> arr2[i][j] ;
}
for (int i=0 ; i<r2 ; i++){
for (int j=0 ; j<c2 ; j++)
cout << arr2[i][j] << " " ;
cout << endl ;
}
int **arr3 = new int * [r2] ;
for(int i=0; i<r2 ;i++){
arr3[i] = new int [c];
}
for (int i = 0; i < r ; i++){
for (int j=0 ; j<c2; j++){
arr3[i][j]=0;
for (int k=0 ; k<c ; k++){
(arr3[i][j])= (arr3[i][j])+((arr[i][k]) * (arr2[k][j]));
}
}
}
cout<<"your matrix is"<<endl;
for(int i=0;i<c;i++){
for(int j=0;j<r2;j++)
cout<<arr3[i][j]<<" ";
cout<<endl;
}
fn(arr);
fn2(arr2);
fn3(arr3);
}
return 0;
}