matrik penjumlahan

#include”iostream.h”
void main(){
int B[3][4],C[3][4],A[3][4];
int i,j;

cout<<“\n Input Matrik A”;
for(i=0;i<3;i++)
for(j=0;j<4;j++){
cout<<“Matrik A[” <<i<<“,”<<j<<“]:”;
cin>>A[i][j];
}
cout<<“\n Input Matrik B”;
for(i=0;i<3;i++)
for(j=0;j<4;j++){
cout<<“Matrik B[“<<i<<“,”<<j<<“]:”;
cin>>B[i][j];
}
for(i=0;i<3;i++)
for(j=0;j<4;j++)
C[i][j]= A[i][j]+B[i][j];

cout<<“Matrik C\n”;
for(i=0;i<3;i++){
for(j=0;j<4;j++){
cout<<C[i][j]<< ” “;
}
cout<<“\n”;
}
}

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