Kehidupan Dunia Maya

Just another WordPress.com weblog

Pengurangan Matrik

eri1#include
int main () {

int i, j;
int A[2][2], B[2][2], C[2][2];

A[0][0] = 4;
A[0][1] = 6;
A[1][0] = 7;
A[1][1] = 2;
B[0][0] = 3;
B[0][1] = 7;
B[1][0] = 8;
B[1][1] = 1;

cout<<“*********************************”<<endl;
cout<<“Nama : ERIADI”<<endl;
cout<<“Nim : 0708002010009″<<endl;
cout<<“Prodi : D-3 INSKOM” <<endl;
cout<<“=================================”<<endl;
cout<<“Hasil :”<<endl;
cout<<endl;

for(i=0; i<=1; i++)
{
for(j=0; j<=1; j++)
{
C[i][j] = A[i][j] – B[i][j];
cout<<C[i][j]<<endl;
}
cout<<endl;

}

return 0;
}

Januari 24, 2009 Posted by | Uncategorized | Tinggalkan komentar

Tugas Komputasi Numerik

Tugas Komputasi Numerik

#include
#include
void main()
{
int baris, kolom;
int i, j;
int A[25][25];
int B[25][25];
int X[25][25];
cout<<“Nama : Eriadi”<<endl;
cout<<“NIM : 0708002010009″<<endl;
cout<<“Prodi : D3-Inskom”<<endl;
cout<<“===============================”<<endl;
cout<<endl;
/******* Masukkan ordo *******/
printf(“masukkan ordo baris = “);
scanf(“%i”,&baris);
printf(“masukkan ordo kolom = “);
scanf(“%i”,&kolom);
/******* Masukkan matriks A *******/
for(i=0;i<baris;i++)
{ for(j=0;j<kolom;j++)
{ printf(“input data matrik A[%i][%i] : “,i+1,j+1);
scanf(“%i”,&A[i][j]);
}
}
/******** Masukkan matriks B ********/
for(i=0;i<baris;i++)
{ for(j=0;j<kolom;j++)
{ printf(“input data matrik B[%i][%i] : “,i+1,j+1);
scanf(“%i”,&B[i][j]);
}
}
/******** Proses penjumlahan matriks A dan B ********/
for(i=0;i<baris;i++)
{ for(j=0;j<kolom;j++)
{ X[i][j]=A[i][j]+B[i][j];
}
}
/******** Cetak isi matriks A ********/
printf(“\n matrik A\n”);
for(i=0;i<baris;i++)
{ for(j=0;j<kolom;j++)
printf(“%6i”,A[i][j]);
printf(“\n”);
}
printf(“\n”);
/******** Cetak isi matriks B *******/
printf(“\n matrik B\n”);
for(i=0;i<baris;i++)
{ for(j=0;j<kolom;j++)
printf(“%6i”,B[i][j]);printf(“\n”);
}
printf(“\n”);
/******** Cetak hasil penjumlahan matriks A dan B *******/
printf(“\n matrik penjumlahan A+B\n”);
for(i=0;i<baris;i++)
{ for(j=0;j<kolom;j++)
printf(“%6i”,X[i][j]);printf(“\n”);
}
printf(“\n\n”);
}

Januari 15, 2009 Posted by | Uncategorized | Tinggalkan komentar

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Januari 15, 2009 Posted by | Uncategorized | 1 Komentar