Array Matrik c++

Soal Buat array 1 dan array 2 [di inputkan array]
Array 3 jumlah array 1 & array 2

#include
#include

int main(){

int A[3][3],B[3][3],C[3][3];
int j,k;

for(j=0;j<3;j++)
{ for(k=0;k<3;k++)
  {
    cout<<"A["<<j<<"]["<<k<<"] = ";
    cin>>A[j][k];
  }
}
cout<<endl;

for(j=0;j<3;j++)
{ for(k=0;k<3;k++)
  {
    cout<<"B["<<j<<"]["<<k<<"] = ";
    cin>>B[j][k];
  }
}
cout<<endl;

for(j=0;j<3;j++)
{ for(k=0;k<3;k++)
  {
    C[j][k]=A[j][k] + B[j][k];
  }
}

for(j=0;j<3;j++)
{ for(k=0;k<3;k++)
  {
    cout<<"C["<<j<<"]["<<k<<"]= "<<C[j][k]<<endl;;
  }
}
getch();
}

Output Program

Selamat mencoba semoga bermanfaat

Iklan

About MrArieve

Bismillah [ Entrepreneur Muda Multitalenta ] Owner: ARC COMPUTER

Posted on November 26, 2010, in Tutorial. Bookmark the permalink. Tinggalkan komentar.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s

%d blogger menyukai ini: