program lat2;
uses wincrt;
function phytagoras(a,b,c:integer):boolean;
begin
if c=sqrt(sqr(a)+sqr(b)) then phytagoras:=true
else phytagoras:=false;
end;
var a,b,c:integer;
hasil:boolean;
begin
write('Masukan sisi A = ');readln(a);
write('Masukan sisi B = ');readln(b);
write('Masukan sisi C (sisi miring) = ');readln(c);
writeln;
hasil:=phytagoras(a,b,c);
if hasil then writeln('phytagoras')
else writeln('bukan phytagoras');
end.
uses wincrt;
function phytagoras(a,b,c:integer):boolean;
begin
if c=sqrt(sqr(a)+sqr(b)) then phytagoras:=true
else phytagoras:=false;
end;
var a,b,c:integer;
hasil:boolean;
begin
write('Masukan sisi A = ');readln(a);
write('Masukan sisi B = ');readln(b);
write('Masukan sisi C (sisi miring) = ');readln(c);
writeln;
hasil:=phytagoras(a,b,c);
if hasil then writeln('phytagoras')
else writeln('bukan phytagoras');
end.
No comments:
Post a Comment