program PointInRectangle;
uses
Types;
var
Rectt: TRect;
Pointt: TPoint;
IsInside: Boolean;
x1, y1, x2, y2, x, y: Integer;
begin
// Define the rectangle using its top-left (x1, y1) and bottom-right (x2, y2) coordinates
x1 := 10; y1 := 10; // Top-left corner
x2 := 60; y2 := 60; // Bottom-right corner
Rectt := Rect(x1, y1, x2, y2);
// Define the point to check
x := 30; y := 20; // Coordinates of the point
Pointt := Point(x, y);
if PtInRect(Rectt, Pointt) then
WriteLn('The point is inside the rectangle.')
else
WriteLn('The point is outside the rectangle.');
end.
(*
run:
The point is inside the rectangle.
*)