Program cobaaj;
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 A = ');readln(a);
write('Masukan B = ');readln(b);
write('Masukan C = ');readln(c);
hasil:=phytagoras(a,b,c);
if hasil then writeln('Segitiga Phytagoras')
else writeln('Segitiga 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 A = ');readln(a);
write('Masukan B = ');readln(b);
write('Masukan C = ');readln(c);
hasil:=phytagoras(a,b,c);
if hasil then writeln('Segitiga Phytagoras')
else writeln('Segitiga Bukan Phytagoras');
end.
No comments:
Post a Comment