title: "if" block without curly braces makes subsequent "else if" nested
body: <p>AFAIK, if an "if" block is not provided the curly braces then only 1 statement is considered inside it. e.g.</p>
  
  <pre><code>if(..)
    statement_1;
    statement_2;
  </code></pre>
  
  <p>Irrespective of tabs, only <code>statement_1</code> is considered inside the <code>if</code> block.</p>
  
  <p>Following code doesn't get along with that:</p>
  
  <pre><code>int main ()
  {
    if(false)  // outer - if
      if(false)  // nested - if
        cout &lt;&lt; "false false\n";
    else if(true)
      cout &lt;&lt; "true\n";
  }
  </code></pre>
  
  <p>Above code doesn't print anything. It should have printed <code>"true"</code>.<br>
  It appears as of the <code>else if</code> is automatically nested inside the <em>outer</em> <code>if</code> block. <code>g++ -Wall</code> issues warning, but that is not the question here. Once you put the curly braces, everything goes fine as expected.</p>
  
  <p>Why such different behavior ?<br>
  [GCC demo: <a href="http://ideone.com/0v0aD">without braces</a> and <a href="http://ideone.com/k7L5Z">with braces</a>].</p>