Skip to content

Instantly share code, notes, and snippets.

@artidataio
Last active July 6, 2022 13:32
Show Gist options
  • Save artidataio/15ceaf37b01a01e8b29a594cd0de52b4 to your computer and use it in GitHub Desktop.
Save artidataio/15ceaf37b01a01e8b29a594cd0de52b4 to your computer and use it in GitHub Desktop.
Fb group pascal debugging
{https://web.facebook.com/photo/?fbid=1106883760205734&set=gm.5560213294029429}
program program_segitiga;
uses crt;
type
segitiga = Record
alas : Integer;
tinggi : Integer;
end;
var st: array [1.. 5] of segitiga;
procedure isiRecord;
var i: Integer;
begin
for i := 1 to 5 do
begin
Write('masukkan alas ', i, ':');
ReadLn(st[i].alas);
Write('masukkan tinggi ', i, ':' );
ReadLn(st[i].tinggi);
end;
end;
procedure cetakRecord;
var
i: Integer;
luas: Real;
begin
for i := 1 to 5 do
begin
luas := 0.5 * st[i].alas * st[i].tinggi;
WriteLn('luas segitiga ', i, ' adalah: ', luas);
end;
end;
begin
clrscr();
WriteLn('... pengisian data segitiga ...');
isiRecord();
WriteLn('... hasil penghitungan luas seigitiga ...');
cetakRecord();
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment