Contoh Jumlah Aray 2 dimensi

Script

#include

#include

int main(){

int A[100][100],B[100][100],C[100][100],a,b,j,k;

cout<<"masukan baris =";cin>>a;

cout<<"masukan kolom =";cin>>b;

cout<<"\nInput Array A\n";

for(j=0;j

{ for(k=0;k

{cout<<"masukan array ["<<<"]["<<<"]>

cin>>A[j][k];}}

cout<<"\n";

cout<<"\nInput Array B\n";

for(j=0;j

{ for(k=0;k

{cout<<"masukan array ["<<<"]["<<<"]>

cin>>B[j][k];}}

cout<<"\n";

cout<<"\nIsi dari array A\n" ;

for(j=0;j

{ for(k=0;k

{cout<<<"\t";}

cout<<"\n";}

cout<<"\nIsi dari array B\n";

for(j=0;j

{ for(k=0;k

{cout<<<"\t";}

cout<<"\n";}

cout<<"\nIsi dari array C (penjumlahan A&B)\n";

for(j=0;j

{ for(k=0;k

{ C[j][k]=A[j][k] + B[j][k];}}

for(j=0;j

{ for(k=0;k

{cout<<<"\t";}

cout<<"\n";}

getch();

}


print screen