#include <iostream>
#include <stdio>
#include <conio>
#include <windows>
void main(){
awal:
clrscr();
system("color 0c");
int matriksa[20][20];
int matriksb[20][20];
int matriksc[20][20];
int barisa, koloma, barisb, kolomb;
cout<<"\t+============================+\n";
cout<<"\t| PERKALIAN MATIKS |\n";
cout<<"\t+----------------------------+\n\n";
textcolor(9);
gotoxy(43,22);
cprintf("Created By : Ade Sopiyan");
gotoxy(43,23);
cprintf("E-mail : adeasop@gmail.com");
gotoxy(1,5);
cout<<"Masukan baris Matriks A : ";
cin>>barisa;
cout<<"Masukan kolom Matriks A : ";
cin>>koloma;
cout<<"\n--------------------------------------------------------\n\n";
cout<<"Masukan baris Matriks B : ";
cin>>barisb;
cout<<"Masukan kolom Matriks B : ";
cin>>kolomb;
if(koloma==barisb){
clrscr();
system("color 0b");
cout<<"\t+============================+\n";
cout<<"\t| PERKALIAN MATIKS |\n";
cout<<"\t+----------------------------+\n\n";
cout<<"Masukan Elemen dari Matriks A : ";
cout<<endl;
for(int a=0;a<barisa;a++){
for(int b=0;b<koloma;b++){
cout<<" Elemen ["<<(a+1)<<","<<(b+1)<<"] : ";
cin>>matriksa[a][b];
}
}
cout<<endl;
cout<<"Masukan Elemen dari Matriks B : ";
cout<<endl;
for(int a=0;a<barisb;a++){
for(int b=0;b<kolomb;b++){
cout<<" Elemen ["<<(a+1)<<","<<(b+1)<<"] : ";
cin>>matriksb[a][b];
}
}
cout<<"---------------------------------------\n";
cout<<"Matriks A : ";
cout<<endl<<endl;
for(int a=0;a<barisa;a++){
for(int b=0;b<koloma;b++){
cout<<" "<<matriksa[a][b]<<"\t";
}
cout<<"\n\n";
}
cout<<"--------------- KALI ------------------\n";
cout<<"Matriks B : ";
cout<<endl<<endl;
for(int a=0;a<barisb;a++){
for(int b=0;b<kolomb;b++){
cout<<" "<<matriksb[a][b]<<"\t";
}
cout<<"\n\n";
}
cout<<"---------------------------------------\n";
cout<<"HASIL : ";
cout<<endl<<endl;
for(int a=0;a<barisa;a++){
for(int d=0;d<kolomb;d++){
matriksc[a][d]=0;
for(int b=0;b<barisa;b++){
matriksc[a][d] = matriksc[a][d] + ( matriksa[a][b] * matriksb[b][d]);
}
cout<<" "<<matriksc[a][d]<<"\t";
}
cout<<"\n\n";
}
cout<<"---------------------------------------\n";
getch();
goto awal;
}else{
gotoxy(3,15);
textcolor(10);
cprintf(" INPUTAN SALAH !! ");
getch();
gotoxy(3,15);
cout<<"\t\t\t";
goto awal;
}
getch();
}
#include <stdio>
#include <conio>
#include <windows>
void main(){
awal:
clrscr();
system("color 0c");
int matriksa[20][20];
int matriksb[20][20];
int matriksc[20][20];
int barisa, koloma, barisb, kolomb;
cout<<"\t+============================+\n";
cout<<"\t| PERKALIAN MATIKS |\n";
cout<<"\t+----------------------------+\n\n";
textcolor(9);
gotoxy(43,22);
cprintf("Created By : Ade Sopiyan");
gotoxy(43,23);
cprintf("E-mail : adeasop@gmail.com");
gotoxy(1,5);
cout<<"Masukan baris Matriks A : ";
cin>>barisa;
cout<<"Masukan kolom Matriks A : ";
cin>>koloma;
cout<<"\n--------------------------------------------------------\n\n";
cout<<"Masukan baris Matriks B : ";
cin>>barisb;
cout<<"Masukan kolom Matriks B : ";
cin>>kolomb;
if(koloma==barisb){
clrscr();
system("color 0b");
cout<<"\t+============================+\n";
cout<<"\t| PERKALIAN MATIKS |\n";
cout<<"\t+----------------------------+\n\n";
cout<<"Masukan Elemen dari Matriks A : ";
cout<<endl;
for(int a=0;a<barisa;a++){
for(int b=0;b<koloma;b++){
cout<<" Elemen ["<<(a+1)<<","<<(b+1)<<"] : ";
cin>>matriksa[a][b];
}
}
cout<<endl;
cout<<"Masukan Elemen dari Matriks B : ";
cout<<endl;
for(int a=0;a<barisb;a++){
for(int b=0;b<kolomb;b++){
cout<<" Elemen ["<<(a+1)<<","<<(b+1)<<"] : ";
cin>>matriksb[a][b];
}
}
cout<<"---------------------------------------\n";
cout<<"Matriks A : ";
cout<<endl<<endl;
for(int a=0;a<barisa;a++){
for(int b=0;b<koloma;b++){
cout<<" "<<matriksa[a][b]<<"\t";
}
cout<<"\n\n";
}
cout<<"--------------- KALI ------------------\n";
cout<<"Matriks B : ";
cout<<endl<<endl;
for(int a=0;a<barisb;a++){
for(int b=0;b<kolomb;b++){
cout<<" "<<matriksb[a][b]<<"\t";
}
cout<<"\n\n";
}
cout<<"---------------------------------------\n";
cout<<"HASIL : ";
cout<<endl<<endl;
for(int a=0;a<barisa;a++){
for(int d=0;d<kolomb;d++){
matriksc[a][d]=0;
for(int b=0;b<barisa;b++){
matriksc[a][d] = matriksc[a][d] + ( matriksa[a][b] * matriksb[b][d]);
}
cout<<" "<<matriksc[a][d]<<"\t";
}
cout<<"\n\n";
}
cout<<"---------------------------------------\n";
getch();
goto awal;
}else{
gotoxy(3,15);
textcolor(10);
cprintf(" INPUTAN SALAH !! ");
getch();
gotoxy(3,15);
cout<<"\t\t\t";
goto awal;
}
getch();
}
Tidak ada komentar:
Posting Komentar