title: Nested for loops to iterate to the power of 2
body: <p>I need to use two loops in such a way that the outer loop drives the inner loop to do computations for 2,4,8,16,and 32 iterations.</p>
  
  <p>for example if i=2(for outer loop)
  then inner loop will iterate for 4 times</p>
  
  <p>and if i=3
  then inner loop will iterate for 8 times and so on.</p>
  
  <p>this is the logic I m using</p>
  
  <pre><code>for ( i = 0 ; i &lt; n ; i++ ) 
       {
           for ( c = 0 ; c &lt;= pow(2,i) ; c=c++ )   
  </code></pre>
  
  <p>I would really appreciate any suggestions</p>