It is possible to define something like 'between' in if-else statement in C#?
<p>I want to ask someone who has stronger skills than me in C#.</p>

<p>Is it possible to reduce the following code</p>

<pre><code>if(val &gt; 20 &amp;&amp; val &lt; 40 )
...
else
if(val &gt; 40 &amp;&amp; val &lt; 72 )
...
else
if(val &gt; 72 &amp;&amp; val &lt; 88 )
...
else
...
</code></pre>

<p>Let's assume that I have over 10-11 <code>if-else</code> statements.</p>

<p>What's the best way to shorten the above code?</p>

<p>I thought at something like <code>between</code> in sql.</p>
