#include <iostream>
#include <stdio.h>
#include <conio.h>
int main()
{
int i, j;
typedef int MATRIX32[3][2];
MATRIX32 A, B, C;
cout<<"MATRIK A"<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
cout<<"A["<<i<<"]["<<j<<"] : "; cin>>A[i][j];
}
}
cout<<endl;
cout<<"MATRIK B"<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
cout<<"B["<<i<<"]["<<j<<"] : "; cin>>B[i][j];
}
}
cout<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
C[i][j] = A[i][j] + B[i][j];
}
}
cout<<"MATRIK C = A+B"<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
cout<<"C["<<i<<"]["<<j<<"] : "<<C[i][j]<<endl;
}
}
return 0;
}
Tidak ada komentar:
Posting Komentar