title: "Loop will run at most once (loop increment never executed)" C++
body: <p>I am receiving a "Loop will run at most once (loop increment never executed)" error causing the loop not to work and I am clueless as to why? Any help would be greatly appreciated. </p>
  
  <pre><code>else if (Selection == 10)
  
  {
      if ((CompareArray[0] == 0 &amp;&amp; CompareArray[1] == 0) ||
  
          (CompareArray[0] == 1 &amp;&amp; CompareArray[1] == 0))
      {
          for(i = 2; i &lt; 6; i++)
          {
              if (CompareArray[i] == 0)
              {
                  return 0;
              }
              return 30;
          }
      }
  
      else if (CompareArray[0] == 0)
      {
          for (i = 1; i &lt; 5; i++)
          {
              if (CompareArray[i] == 0)
              {
                  return 0;
              }
              return 30;
          }
      }
  
      else
      {
          for (i = 0; i &lt; 4; i++)
          {
              if (CompareArray[i] == 0)
              {
                  return 0;
              }
              return 30;
          }
      }
  }
  </code></pre>