title: Use of unassigned local variable in C#
body: <p>I am currently tasked with having a user enter in 5 variables. With the variables I need to create a series of loops to read the variables and assign them to variables. I am required to use only 1 <code>Console.ReadLine();</code> I currently have this set up:</p>
  
  <pre><code>string userName = ""; 
  int v1, v2, v3, v4, v5 = 0;  
  
  int i = 1;
  
  while (i &lt;= 5)
  {
      int InputCheck = 0;
      Console.WriteLine("Please input a number {0} between 10 and 50;", i);
      InputCheck = Convert.ToInt32(Console.ReadLine());
  
      if (InputCheck &gt;= 10 &amp;&amp; InputCheck &lt;= 50) 
      {
  
          //if (i &gt;= 10 &amp;&amp; i &lt;= 50)
              //i++;
  
          if (i == 1)
          {
              InputCheck = v1;
          }
  
          else if (i == 2)
          {
              InputCheck = v2;
          }
  
          else if (i == 3)
          {
              InputCheck = v3;
          }
  
          else if (i == 4)
          {
              InputCheck = v4;
          }
  
          else if (i == 5)
          {
              InputCheck = v5;
          }
  
          if (InputCheck &lt; 10 || InputCheck &gt; 50)
          {
              Console.WriteLine("The number you entered is either to high or to low please re-enter a number:");
          }
      }
  </code></pre>
  
  <p>I am confused as to why I'm getting the error Use of unassigned variables. Any help would be greatly appreciated.</p>