#include
#include
#include
using namespace std;
int i, j, k, baris, kolom, m1[10][10], m2[10][10], hasil[10][10];
int main(int argc, char *argv[])
{
cout<<"Operasi Pengurangan dan Penjumlahan Matriks\n\n";
do
{
cout<<"Jumlah Baris : "; cin>>baris;
cout<<"Jumlah Kolom : "; cin>>kolom;
}
while ((baris>10)||(kolom>10));
cout<<"\nMatriks A "<
for(i=0;i
for(j=0;j
cout<<"data["<
for(i=0;i
for(j=0;j
cout<<"data["<
cout<<"Matriks A + Matriks B = Matriks C\n";
for(i=0;i
for(j=0;j
cout<
cout<<" ";
for(j=0;j
cout<
cout<<" ";
for(j=0;j
cout<
cout<
}
for(i=0;i
for(j=0;j
hasil[i][j]=m1[i][j] - m2[i][j];
}
for(k=0;k<3;k++)
hasil[i][j] = hasil[i][j] - m1[i][j] - m2[i][j];
cout<<"\nHasilnya... "<
cout<<"Matriks A - Matriks B = Matriks C\n";
for(i=0;i
for(j=0;j
cout<
cout<<" ";
for(j=0;j
cout<
cout<<" ";
for(j=0;j
cout<
cout<
}
cout<
system("PAUSE");
return EXIT_SUCCESS;
}
0 komentar:
Posting Komentar