title: use of "else if" in c++
body: <p>I have two questions -
  (I)</p>
  <pre><code>code-fragment-1
  
  if(&lt;condition-statement&gt;){
  }
  
  else if(&lt;condition-statement-2&gt;){
      //statements-1
  }
  //statements-2
  </code></pre>
  <p>code-fragment-2</p>
  <pre><code>if(&lt;condition-statement&gt;){
  }
  
  else{
      if(&lt;condition-statement-2&gt;){
          //statements-1
      }
      //statements-2
  }
  </code></pre>
  <p>Are the above two code fragments same?</p>
  <p>(II) when are <code>else if</code>s (in C++) used?</p>