Categories

Budaya (3) Cerpen (2) Cooking (1) Curhat (29) Curug (1) Famz Story (4) fiktif (3) Film (14) Foto (36) Hiking (30) Indonesia (80) INDONESIA BAGUS (7) Info (111) Islam (3) Jepang (7) Kampus (83) Kartun (1) Kids (2) Komputer (34) Kopdar (1) Korean Fever (14) Listing Program (8) Look Alike (10) Maen (28) Multimedia (9) Musik (3) Muslimah (4) Ramadhan (1) Review (16) SAR (2) Sekedar Tulisan (49) Shout Out (6) SI (53) Situs Bersejarah (2) Team Mandalawangi (1) Trip (33) Tugas (86) Untuk Negeri (76) Video (3) Wisata (11)

Kamis, 16 Februari 2012

Pascal - Array Dimensi 2

program rata_array_dimensi2;
uses crt;

var

        rata:real;i,k,n,d,f,e:integer;
        nilai:array[1..3,1..3] of real;
        total:array[1..3] of real;
begin
clrscr;
n:=7;e:=26;
gotoxy(25,3);writeln('*********************************');
gotoxy(25,4);writeln('            ELEMENT ARRAY');
gotoxy(25,5);writeln('*********************************');
for i:=1 to 3 do begin
         for k:=1 to 3 do
         begin
         gotoxy(25,n);write('Masukkan nilai indeks data(',i,',',k,')=')
         ;readln(nilai[i,k]);
         total[i]:=total[i]+nilai[i,k];
         n:=n+1;
         end;
end;
i:=0;
k:=0;
gotoxy(55,e);writeln('*********************************');
for i:=1 to 3 do begin
         for k:=1 to 3 do begin
         gotoxy(6,e);
         writeln('*nilai indeks[',i,',',k,']',nilai[i,k]:2,1,')');
         end;
end;
i:=0;
gotoxy(55,e+1);writeln('*******************************');
for i:=1 to 3 do
begin
        Rata:=(total[i]/k);
        writeln('*rata rata indeks[',i,']=',
rata:2,1,' *');
end;
writeln('*****************************');
readln;
end.

Tidak ada komentar:

Posting Komentar