Catatan Kuliahku... (C++ perkalian matriks)

#include
#include
void main ()
{
clrscr();
cout<<" PERKALIAN MATRIK "<
cout<<" A[2][3] - B[2][3] x C[2][3] "<
int A[2][3],B[2][3],C[2][3],total1[2][3],total2[2][3],i,j;
for (i=0; i<2; i++)
{ cout<
for(j=0; j<3; j++)
{
cout<<" NILAI A " <<<","<<<" = ";
cin>>A[i][j];
}
}
for(i=0; i<2; i++)
{ cout<
for(j=0; j<3; j++)
{
cout<<" NILAI B " <<<","<<<" = ";
cin>>B[i][j];
}
}
for(i=0; i<2; i++)
{ cout<
for(j=0; j<3; j++)
{
cout<<" NILAI C " <<<","<<<" = ";
cin>>C[i][j];
}
}
for(i=0; i<2; i++)
{
for(j=0; j<3; j++)
{
total1[i][j]=(C[i][j]*B[i][j]);
total2[i][j]=A[i][j]- total1[i][j];
}
}
for(i=0; i<2; i++)
{ cout<
for(j=0; j<3; j++)
{
cout<< " Total ke " << "["<<<"]" << "["<<<"]:"<
}
}
cout<
for(i=0; i<2; i++)
{ cout<
for(j=0; j<3; j++)
{
cout<< " Total ke " << "["<<<"]" << "["<<<"]:"<
}
}

getch();
}

Tidak ada komentar:

Posting Komentar