Hi..
how to calculate distance between two points..
each point have a coordinates (x,y).

please help..

See if this help :

Program CalculateDistance;
Uses WinCrt;
var
	x1,x2,y1,y2:integer;
	d:real;
begin
	Writeln;
	Write('Input A (X1): ');readln(x1);
	Write('Input B (X2): ');readln(x2);
	Write('Input A (Y1): ');readln(y1);
	Write('Input B (Y2): ');readln(y2);
	d:=sqrt(sqr(x2-x1)+sqr(y2-y1));
	Writeln;
	Writeln('Distance between A and B is: ',d:4:2);
end.
commented: Quick respon +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.