source code:
type Pmhs = ^Tmhs;
Tmhs = record
nama: string;
npm: string;
kelas: string;
end;
var
arrMhs: array[1..50] of Pmhs;
i, n: integer;
begin
writeln('INPUT DATA');
write('Masukan Banyak Data : ');
readln(n);
for i := 1 to n do
begin
new(arrMhs[i]);
write('Masukan Nama ke-',i,' : ');
readln(arrMhs[i]^.nama);
write('Masukan NPM ke-', i, ' : ');
readln(arrMhs[i]^.npm);
write('Masukakn Kelas ke-', i, ' : ');
readln(arrMhs[i]^.kelas);
end;
writeln('OUTPUT DATA');
for i := 1 to n do
begin
writeln('Nama ke-', i, ' : ', arrMhs[i]^.nama);
writeln('NPM ke-', i, ' : ', arrMhs[i]^.npm);
writeln('Kelas ke-', i, ' : ', arrMhs[i]^.kelas);
end;
end.
run:
Komentar
Posting Komentar