title: int.Parse is not working with string value (System.FormatException: Input string was not in a correct format )
body: <p>If a user inputs anything but a number I get Unhandled Exception:</p>
  
  <blockquote>
    <p>System.FormatException: Input string was not in a correct format.</p>
  </blockquote>
  
  <p>Can someone explain what I am doing wrong?</p>
  
  <p>Here's my code C# .NET:</p>
  
  <pre><code>private static int WeightIFeMale()
  {
      Console.WriteLine("How Much Do You Weigh?", Environment.NewLine);
      int femaleWeight = int.Parse(Console.ReadLine());
  
      if 
          (0 &gt;= femaleWeight &amp;&amp; 80 &lt;= femaleWeight)
      {
          Console.WriteLine("Damn, how much crack are you smoking?", Environment.NewLine);
      }
      else if
          (81 &gt;= femaleWeight &amp;&amp; 110 &lt;= femaleWeight)
      {
          Console.WriteLine("What the ****, are you a midget *****?", Environment.NewLine);
  
      }        
      else if 
          (111 &gt;= femaleWeight &amp;&amp; 140 &lt;= femaleWeight)
      {
          Console.WriteLine("Holy shit, I have some protein bar coupons you can have!", Environment.NewLine);
  
      }
      else if 
          (141 &gt;= femaleWeight &amp;&amp; 160 &lt;= femaleWeight)
      {
          Console.WriteLine("Bro you need to hit the Gym, ASAP!", Environment.NewLine);
  
      }
      else if 
          (161 &gt;= femaleWeight &amp;&amp; 200 &lt;= femaleWeight)
      {
          Console.WriteLine("Really!!!, can I hit the Gym with you?", Environment.NewLine);
  
      }
      else if 
          (201 &gt;= femaleWeight &amp;&amp; 240 &lt;= femaleWeight)
      {
          Console.WriteLine("Do you Have a small ****, Steroids are a mother @#$%^&amp;&amp;", Environment.NewLine);
  
      }
      else if 
          (241 &gt;= femaleWeight &amp;&amp; 999 &lt;= femaleWeight)
      {
          Console.WriteLine("My condolences!", Environment.NewLine);
      }
      else if 
          (femaleWeight &gt;= 1000)
      {
          Console.WriteLine("There is absolutely no way that you weigh {0} lbs, so stop ******* around!", femaleWeight, Environment.NewLine);
      }
      else
      {
          Console.Write("What the **** is {0} It has to be a number numb nuts, lets try that again!", Environment.NewLine);
          WeightIFeMale();
      }
  
      return femaleWeight;
  }
  </code></pre>