uses crt;
var
X1,x2,y1,y2:integer;
d:real;
begin
clrscr;
writeln(‘Program Menghitung Jarak Titik A dan B’);
writeln(‘======================================’);
writeln;
write(‘Masukan Nilai A (X1):’);readln(x1);
write(‘Masukan Nilai B (X2):’);readln(x2);
write(‘Masukan Nilai A (Y2):’);readln(y2);
write(‘Masukan Nilai B (Y2):’);readln(y2);
d:=sqrt(sqr(x2-x1)+sqr(y2-y1));
writeln;
writeln(‘Jadi Jarak Titik A ke B Adalah:’,d:4:2);
readln;
end.
Sign up here with your email
ConversionConversion EmoticonEmoticon