Posted by : Dedy Al Islami Selasa, 18 Mei 2010

#include
#include
main()
{
int i,j,n,m;
float b[50][50];
float a[50][50];
float c[50][50];
clrscr();
printf (“PENJUMLAHAN MATRIX…..\n”);
printf (“masukan baris : “);
scanf (“%d”,&n);
printf (“masukan kolom : “);
scanf (“%d”,&m);
printf (“MATRIX A: \n”);
for (i=1;i<=n;i++)
for (j=1;j<=m;j++)


{
gotoxy((j-1)*5+3,5+i);
scanf(“%f”,&a[i-1][j-1]);
}
printf (“\n”);
printf (“masukan baris : “);
scanf (“%d”,&n);
printf (“masukan kolom : “);
scanf (“%d”,&m);
printf (“MATRIX B: \n”);
for (i=1;i<=n;i++)
for (j=1;j<=m;j++)
{
gotoxy((j-1)*5+3,10+i+n);
scanf(“%f”,&b[i-1][j-1]);
}
printf (“\n”);
printf (“HASIL PENJUMLAHAN MATRIX A+B”);
printf (“MATRIX C: \n”);
for (i=1;i<=n;i++)
for (j=1;j<=m;j++)
{
c[i-1][j-1]=a[i-1][j-1]+ b[i-1][j-1];
gotoxy((j-1)*5+3,11+i+2*n);
printf(“%2.0f”,c[i-1][j-1]);
}
getche ();
}

Masukkan Komentar anda di bawah kolom ini :

Subscribe to Posts | Subscribe to Comments

Pengunjung Blog

Berita terbaru

Diberdayakan oleh Blogger.