ini dia source code nya :
silahkan di coba dan semoga bermanfaat !!!
#include "iostream.h"
void main(){
int B[3][4],C[3][4],A[3][4];
int i, j;
cout<<"Input Matrik A\n";
for(i=0; i<3; i++)
for(j=0; j<4; j++){
cout<<"Matrik A["<<i<<","<<j<<"] : ";
cin>>A[i][j];
}
cout<<"\n Input Matrik B\n";
for(i=0; i<3; i++)
for(j=0; j<4; j++){
cout<<"Matrik B["<<i<<","<<j<<"] : ";
cin>>B[i][j];
}
for(i=0; i<3; i++)
for(j=0; j<4; j++)
C[i][j]=A[i][j]+B[i][j];
cout<<"\nMatrik C \n";
for(i=0; i<3; i++){
for(j=0; j<4; j++){
cout<< C[i][j]<<" ";
}
cout<<"\n";
}
}
silahkan di coba dan semoga bermanfaat !!!
#include "iostream.h"
void main(){
int B[3][4],C[3][4],A[3][4];
int i, j;
cout<<"Input Matrik A\n";
for(i=0; i<3; i++)
for(j=0; j<4; j++){
cout<<"Matrik A["<<i<<","<<j<<"] : ";
cin>>A[i][j];
}
cout<<"\n Input Matrik B\n";
for(i=0; i<3; i++)
for(j=0; j<4; j++){
cout<<"Matrik B["<<i<<","<<j<<"] : ";
cin>>B[i][j];
}
for(i=0; i<3; i++)
for(j=0; j<4; j++)
C[i][j]=A[i][j]+B[i][j];
cout<<"\nMatrik C \n";
for(i=0; i<3; i++){
for(j=0; j<4; j++){
cout<< C[i][j]<<" ";
}
cout<<"\n";
}
}
gk fungsi ihh
BalasHapus