C# Switch Statement with multiple ifs to Calculate a range of numbers : <p>I am new to C# and am making a windows form in .net and am using the following switch statement where I am calculating the the BMI of candidates. After testing this program it will execute the first case, but then the following cases dont work. </p>

<p>Thank you for your help.
-Mike</p>

<p><em>Where SwitchFinal is the calculated BMI, and Age being a variable holding the user inputed age</em></p>

<pre><code>  int switchvar = 1;
               switch (switchvar)
               {

                   case 1:
                    if (Age &gt;= 17 &amp;&amp; Age &lt; 21 &amp;&amp; SwitchFinal &lt; 20)
                    {

                        MessageBox.Show("Candidate is Eligible!");

                    }
                    else
                    {
                        MessageBox.Show("Candidate is Not Eligible");
                    }
                    break;

                case 2:
                    if (Age &gt;= 21 &amp;&amp; Age &lt; 28 &amp;&amp; SwitchFinal &lt; 22)
                    {

                        MessageBox.Show("Candidate is Eligible!");

                    }
                    else
                    {
                        MessageBox.Show("Candidate is Not Eligible");
                    }
                    break;
                case 3:
                    if (Age &gt;= 28 &amp;&amp; Age &lt;40 &amp;&amp; SwitchFinal &lt; 24)
                    {

                        MessageBox.Show("Candidate is Eligible!");

                    }
                    else
                    {
                        MessageBox.Show("Candidate is Not Eligible");
                    }
                    break;

                case 4:
                    if (Age &gt;= 40 &amp;&amp;  SwitchFinal &lt; 24)
                    {

                        MessageBox.Show("Candidate is Eligible!");

                    }
                    else
                    {
                        MessageBox.Show("Candidate is Not Eligible");
                    }
                    break;
</code></pre>
