title: While loop and try and catch
body: <p>The code tells me when the input is not a number, but it also writes the else if code at the same time.<br>
  I belive it has something to do with me assigning the number 0 to doubleNr at the top double varible, but if I don't, I get <strong><em>Use of unassigned local variable 'doubleNr'</em></strong> in the while condition.<br>
  Also, where am I supose to write the <strong><em>doubleNr = myMethod(intNr);</em></strong> line?<br>
  In the try block or between the catch and the if block?</p>
  
  <pre><code>int intNr;
  double doubleNr = 0;
  
  while (doubleNr &lt; 20 || doubleNr &gt; 30)
  {
      Console.WriteLine("Enter your number: ");
      string strNr = Console.ReadLine();
      try
      {
          intNr = Convert.ToInt32(strNr);
          doubleNr = myMethod(intNr);  // Should this line go here?
      }
      catch
      {
          Console.WriteLine("Number must be INT");
      }
      // or should it go here?
  
      if (doubleNr &lt; 20)
      {
          Console.WriteLine("Try a higher number.");
      }
      else if (doubleNr &gt; 30)
      {
          Console.WriteLine("Try a lower number.");
      }
  }
  Console.WriteLine("That is a good number."); 
  </code></pre>