Selasa, 30 April 2013

Program Record Pascal

uses crt;
type
data_mhs = record
nama :string [20];
kelas :string [15];
npm :string [8]
end;
var
mhs:array[1..2]of data_mhs;
d,i:integer;
begin
clrscr;
write(' data yang di masukan : ');
readln(i);
for d := 1 to i do
with mhs [d] do
begin
writeln(' record ke:',d);
write('nama:');
readln(nama);
write('kelas:');
readln(kelas);
write('npm:');
readln(npm);
end;
writeln;
writeln;
for d:= 1 to i do
with mhs [d] do
begin
writeln('nama : ', nama);
writeln('kelas : ', kelas);
writeln('npm : ', npm);
end;
readln;
end.

Tidak ada komentar:

Posting Komentar