title: inbound loop control varible out of bounds?
body: <p>Hello :) I am novice programmer, please help me with the error "Index was out of bounds of the array" I think I am taking into consideration that the value that I am trying to use as my lcv is higher than that of the size of the array. I would really appreciate simplicity in the solution.    </p>
  
  <pre><code>static void Main(string[] args)
          {
              Console.WriteLine("enter a number");
              /**********************************************************/
              string inputString = Console.ReadLine();
              int inputNum;
              int.TryParse(inputString, out inputNum);
              int[] divisorsArray = new int[inputNum -2];
              int[] filteredArray = new int[] { };
              int divisor = 1;
              int yum = 0;
              /**********************************************************/
              for (int i = 0; i &lt; inputNum -2; i++)
              {
  
                  if ( divisor != inputNum &amp;&amp; inputNum % divisor == 0)
                      divisorsArray[i] = divisor;                  
                  Console.WriteLine(divisorsArray[i]);
                  divisor++;
                  if (divisorsArray[i]&gt;0)
                  {
  
                      filteredArray[yum] = divisorsArray[i];
                      yum++;
                  }
              }
              Console.ReadKey();
  
          }
  </code></pre>