Program Pascal : Menghitung Keliling Lingkaran

program keliling_lingkaran;
uses wincrt;

type tab=record
     p:real;
     t:real;
     end;

function sm(a:tab):real;
begin
sm:=(sqrt(sqr(a.p)+sqr(a.t)));
end;

function kll(a:tab):real;
begin
kll:=(a.p+a.t+sm(a));
end;

var
a:tab;
hsl:real;

begin
readln(a.p);
readln(a.t);
hsl:=kll(a);
writeln;
writeln(hsl:0:2);
end.

0 comments:

Komentar