title: Multiple else if statements
body: <p>i have this c code, regarding multiple if statements..
  All statements are working nicely, except the final one..
  It gets activated with other if statements and so ruins the result..
  Any suggestions?</p>
  
  <pre><code>  for (i=0; i&lt;(total); i++)
    {
      for (n=0; n&lt;((total)/4); n++)
      {
          if (i==(0+(n*4)) &amp;&amp; i&lt;(total-5)&amp;&amp;(array[i]==0))
          {
              array[i]=1;
              i=n=500;                                     
              break;
          }
          else if ((i==(3+(n*4)))&amp;&amp;i&lt;(total-5)&amp;&amp;(array[i]==0))
          {
              array[i]=1;
              i=n=500;
              break;
          }
          else if (i==(total)&amp;&amp;(array[i]==0))
          {
              array[i]=1;
              i=n=500;
              break;
          }
          else if (i==(total-1)&amp;&amp;(array[i]==0))
          {
              array[i]=1;
              i=n=500;
              break;
          }
          else
              printf("**Something**");
      }
    }
  }
  </code></pre>