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

About arieve techno

My name arieve, i'm from Purworejo..i live in Yogyakarta more aboute me YM/twitter : arieve_techno

Posted on November 26, 2010, in Tutorial. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: