For a program I am working on, I need a way to use an if function for a variable, if the variable is within a certain range of numbers. i.e.
if(x == 1-5) // meaning if x is from 1 to 5
//do something...
if(x == 6-10) // i.e. if x is from 6 to ten
//do something
if(x == 11-15)// ... etc
//do something
I know the code I provided is wrong and all, but it explains what I am trying to do. Does anyone know how to do it?