Why multiple if works and if else does not it this case : <p>I'm learning C and I've came around a strange problem. I think I understand the difference between multiple ifs and else-if statement, but I simply can not understand the difference in behavior this time. If I delete the else keyword it works as intended, but with else on it does not. </p>

<p>The code is about counting of occurrences of each letter without differentiating lower case or upper case (so 'a' and 'A' both counts as 1 occurrence for letter 'a').</p>

<p>I've tried omitting braces where I could but nothings changed so I've left them in to avoid caveats.</p>

<pre><code>while ((c = getchar()) != EOF)
{
if ('A' &lt; c &lt; 'Z')
    {
        ++array[c - 'A'];
    }
    else if ('a' &lt; c &lt; 'z')
    {
        ++array[c - 'a'];
    }
}
</code></pre>

<p>When I type in 'a' then the array is not being incremented, but if I delete the else statement thus switching to a multiple if situation, it works as intended. Letter 'A' updates the array nicely in both cases. </p>

<p>Could you please help me understand the difference in behavior in this case?</p>
