title: How to use try/catch to check for whether a number is within a range of 1-3? c#
body: <pre><code>        /*Propmt user for beverages*/
          while (!bool_valid)
          {
              bool_valid = true;
              Console.WriteLine("Plesae Choose a Drink; Press 1 for Coke, Press 2 for Sprite, Press 3 for Dr.Prpper");
              try
              {
                  int_bvg_type = Convert.ToInt32(Console.ReadLine());
                  (int_bvg_type &gt; 0) &amp;&amp; (int_bvg_type &lt; 4);
              }
              catch
              {
                  Console.WriteLine("PLease enter a Number between 1 and 3");
                  bool_valid = false;
              }
          }
  </code></pre>
  
  <p>I need to make sure a numerical input, as a variable, is between 1 and 3 and was wondering how to do it with C# and <code>Try/Catch</code>. I tried <code>(int_bvg_type &gt; 0) &amp;&amp; (int_bvg_type &lt; 4);</code>... but I get an error saying I cannot use it as a statement. Could someone please explain how to check to see if a number is between 1 and 3 using <code>Try/Catch</code>.</p>