#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
int i, j;
int Matriks[100][100];
cout<<"\n\t"<<char(5)<<" Program Cek Matrik Diagonal 3x3 "<<char(5)<<endl<<endl;
cout<<"Nama : Mamat Aji"<<endl;
cout<<"Nim : 12018057"<<endl;
cout<<"Kelas : B"<<endl<<endl;
cout<<"Matrik ordo 3x3\n"<<endl;
cout<<"0 0 0"<<endl;
cout<<"0 0 0 "<<endl;
cout<<"0 0 0"<<endl<<endl;
cout<<"Input Matriks :\n";
for(i=1; i<=3; i++){
for(j=1; j<=3; j++){
cout<<"Baris "<<i<<", Kolom "<<j<<" : ";
cin>>Matriks[i][j];
}}
cout<<endl;
cout<<"Hasil : \n"<<endl;
for(i=1; i<=3; i++){
for(j=1; j<=3; j++){
cout<<Matriks[i][j]<<" ";
}
cout<<endl;
}
cout<<endl;
if(Matriks[i=0][j=0] == 1){
if(Matriks[i=0][j=0] == 1){
if(Matriks[i=0][j=0] == 1){
cout<<"==> Keterangan : Bukan Matriks Diagonal!!! "<<char(1)<<endl;
}}}
else{cout<<"==> Keterangan : Matriks Diagonal..."<<endl;}
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
int i, j;
int Matriks[100][100];
cout<<"\n\t"<<char(5)<<" Program Cek Matrik Diagonal 3x3 "<<char(5)<<endl<<endl;
cout<<"Nama : Mamat Aji"<<endl;
cout<<"Nim : 12018057"<<endl;
cout<<"Kelas : B"<<endl<<endl;
cout<<"Matrik ordo 3x3\n"<<endl;
cout<<"0 0 0"<<endl;
cout<<"0 0 0 "<<endl;
cout<<"0 0 0"<<endl<<endl;
cout<<"Input Matriks :\n";
for(i=1; i<=3; i++){
for(j=1; j<=3; j++){
cout<<"Baris "<<i<<", Kolom "<<j<<" : ";
cin>>Matriks[i][j];
}}
cout<<endl;
cout<<"Hasil : \n"<<endl;
for(i=1; i<=3; i++){
for(j=1; j<=3; j++){
cout<<Matriks[i][j]<<" ";
}
cout<<endl;
}
cout<<endl;
if(Matriks[i=0][j=0] == 1){
if(Matriks[i=0][j=0] == 1){
if(Matriks[i=0][j=0] == 1){
cout<<"==> Keterangan : Bukan Matriks Diagonal!!! "<<char(1)<<endl;
}}}
else{cout<<"==> Keterangan : Matriks Diagonal..."<<endl;}
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}