Powered By Blogger Submit Your Site To The Web's Top 50 Search Engines for Free! Online Marketing

Subscribe Now

Monday, March 30

Program Matriks pada Pascal

Tampilan Program Array Matriks saat peng-codingan:


Coding Program Array Matriks pada Pascal:

USES CRT;
VAR
MATRIKS1,MATRIKS2,HASIL: ARRAY [1..2,1..2]
OF INTEGER;
I: INTEGER;
J: INTEGER;
BEGIN
CLRSCR;
FOR I:=1 TO 2 DO
BEGIN
FOR J:=1 TO 2 DO
BEGIN
GOTOXY (4+J*4, 10+I);
READLN (MATRIKS1[I,J]);
END;
END;
FOR I:=1 TO 2 DO
BEGIN
FOR J:=1 TO 2 DO
BEGIN
GOTOXY (25+J*4, 10+I);
READLN (MATRIKS2[I,J]);
END;
END;
FOR I:=1 TO 2 DO
BEGIN
FOR J:=1 TO 2 DO
BEGIN
HASIL [I,J]:=(MATRIKS1[I,J+J]+
MATRIKS2[J,I+I]*MATRIKS1[I,J+J]+MATRIKS2[J,I]);
GOTOXY (46+J*4, 10+I);
WRITELN (HASIL [I,J]);
END;
END;
READLN;
END.

Tampilan Output Program Array Matriks pascal:


Logika Program Array Matriks Pascal:



Program Matriks ini mengajak kita untuk menentukan isi dari matriks1 dan matriks2, dimana nantinya isi dari matriks 1 akan di kalikan dengan matriks 2, contoh pada output diatas, kita masukkan

19           10                           12           21                                                           232         273
                                                        Akan Menghasilkan
10           20                           13           12                                                           281         5766

Related Posts


0 Comments:

Post a Comment

Popular Posts This Months

Related Posts Plugin for WordPress, Blogger...