Tugas
Praktikum Ke-5
Nama : Achmad Kharis
NIM : J1F114002
Shift
: 3 (Tiga)
1.
Screenshot
Program
Gambar 1 : Tampilan Program Saat pertama di jalankan
Gambar
2 : Tampilan saat mengiputkan jumlah data
Gambar
3 : Tampilan hasil pengurutan secara Ascending dan Descending
2.
Source
Code
Program pointer_tak_bertipe;
uses
crt;
var
p
: Pointer;
q
: ^Byte;
r
: array [0..100] of Byte;
i,j
: Byte;
n,m
: integer;
begin
clrscr;
GetMem(p, 20);
q := p;
writeln('
Program Pointer Tidak Bertipe
');
writeln(' Pengurutan Angka ');
writeln('
Secara Ascending & Descending
');
writeln;
writeln;
write
(' Input jumlah data:
' ); readln(n);
writeln;
writeln('
Ascending <> Descending ');
for i
:= 1 to n do
begin
r[i] := n - i ;
q^ := n - i;
inc(q);
end;
q := p;
for i := n downto 1 do
begin
write(' ',r[i],' ');
writeln(q^);
inc(q);
end;
readln;
end.
|
Posting Komentar