#include
#include
void main () {
typedef int matrik22[2][2];
matrik22 A,B,C ;
int i,j,k;
//A
for(j=0;j<2 br="" j=""> { for(i=0;i<2 br="" i=""> {
cout<<"Matrik A["<
}
}
cout<
//B
for(j=0;j<2 br="" j=""> { for(i=0;i<2 br="" i=""> {
cout<<"Matrik B["<
}
}
//perkalian array A dan B
for(j=0;j<2 br="" j=""> { for(i=0;i<2 br="" i="">
{
C[j][i]=0;
for ( k=0;k<2 br="" k="">{
C[j][i]+=A[j][k]*B[k][i];
}
}
}
//menampilkan hasil pengalian matrik A dan B
cout<<"\nHasil Perkalian Matrik A dan B \n";
for (j=0;j<2 br="" j="">{ for(i=0;i<2 br="" i=""> {
cout<<"["<
}
No comments:
Post a Comment