My problem is to write C++ code calculate Matrix multiplication i wrote the code but the main problem in changing it into function not in the main and i don't know how !!! could anybody help me please and tell me hint or what's the lesson that should i learn before solving this problem.
That's the code
http://codepad.org/s36rcxls
1
Expert's answer
2013-05-09T08:25:43-0400
#include<iostream>
using namespace std;
void compute(){
int l,m,z,n; int matrixA[10][10]; int matrixB[10][10]; int matrixC[10][10];
cout<<"enter the dimension of the first matrix"<<endl; cin>>l>>m; cout<<"enter the dimension of the second matrix"<<endl; cin>>z>>n;
if(m!=z||z!=m){ cout<<"error in the multiblication enter new dimensions"<<endl; cout<<"enter the dimension of the first matrix"<<endl; cin>>l>>m; cout<<"enter the dimension of the second matrix"<<endl; cin>>z>>n; }
Comments
Leave a comment