title: simple logic question: check if x is between 2 numbers
body: <p>I want to see if a variable is between a range of values, for example if x is between 20 and 30 return true.</p>
  
  <p>What's the quickest way to do this (with any C based language)? </p>
  
  <p>It can obviously be done with a for loop:</p>
  
  <pre><code>function inRange(x, lowerbound, upperbound)
  {
    for(i = lowerbound; i &lt; upperbound; i++)
    {
      if(x == i) return TRUE;
      else return FALSE;
    }
  }
  //in the program
  if(inRange(x, 20, 30))
     //do stuff
  </code></pre>
  
  <p>but it's awful tedious to do <code>if(inRange(x, 20, 30))</code> is there simpler logic than this that doesn't use built in functions?</p>