Question: Checking intervals

Hi,

I'm having some trouble with finding an algorithm to check  which interval , the element 'x' is part of.

for instance : say I want to know if x belongs in , A := [ a, b ] or B := [c,d] or..... 

How does one write the proper code for such a problem?

Thanks a lot in advance,

Yoeri.

 

Please Wait...