need help with logics

You need more parenthesis:

if (x<=100 || x>=230 && (y>=180 || y<20))

if ((x<=100) || ((x>=230) && ((y>=180) || (y<20))))

You must be very precise about what comparison is being done where - leave no doubt.

Don’t count on operator precedence, just brute force it.