public static void Main()
var test1 = IsInRectangle(5,5,0,0,10,10);
var test2 = IsInRectangle(5,5,-10,-10,-50,-50);
var test3 = IsInRectangle(-5,-5,-10,-10,-50,-50);
var test4 = IsInRectangle(5,5,10,-10,-50,50);
var test5 = IsInRectangle(-25,-15,-50,-50,-10,-10);
var test6 = IsInRectangle(-10,-10,-1,-1,-10,-10);
Console.WriteLine("test1 is "+ test1);
Console.WriteLine("test2 is "+ test2);
Console.WriteLine("test3 is "+ test3);
Console.WriteLine("test4 is "+ test4);
Console.WriteLine("test5 is "+ test5);
Console.WriteLine("test6 is "+ test6);
private static bool IsInRectangle(int x, int y, int x1, int y1, int x2, int y2)
return ((x1 <= x) && (x2 >= x)) && ((y1 <= y) && (y2 >= y));