Program Penambahan Matriks
Tuesday, July 23, 2013
0
comments
#include"iostream.h"
void main()
{
int a[3][3], b[3][3],c[3][3];
int i,j;
cout<<"Program Penambahan Matrik\n";
cout<<"\n Input Matrik A:";
for(i=0;i<=2;i++)
for(j=0;j<=2;j++)
{
cout<<"Nilai a["< cin>>a[i][j];
}
cout<<"\n Input Matrik B:";
for (i=0;i<=2;i++)
for(j=0;j<=2;j++)
{
cout<<"Nilai b["< cin>>b[i][j];
}
for(i=0;i<=2;i++)
for(j=0;j<=2;j++)
c[i][j]=a[i][j]+b[i][j];
cout<<"Matrik C";
for(i=0;i<=2;i++)
for(j=0;j<=2;j++)
cout<<"\nc["<}