title: How to use greater than or equal in a switch statement
body: <p>What is the best way to check if variable is bigger than some number using switch statement? Or you reccomend to use if-else? I found such an example: </p>
  
  <pre><code>int i;
  
  if(var1&gt;var2) i = 1;
  if(var1=var2 i = 0;
  if(var1&lt;var2) i = -1;
  
  switch (i);
  {
      case -1:
      do stuff;
      break;
  
      case 0:
      do stuff;
      break;
  
      case 1:
      do stuff;
      break;
  
  }
  </code></pre>
  
  <p>What can you tell a novice about using "greater than or equal" in switch statements?</p>