title: 2^power without using math.pow and multiplication
body: <p>Is there any way to use code 2^power without using math.pow or multiplication operator.
  So far,</p>
  
  <p>I've though of using 2 counters and additions, but my programs doesn't seem to be working. Here is my work thus far.</p>
  
  <pre><code>int counter=0; // k 
  int userNumber=0; // p 
  int power=0;
  int sum=0;
  
  cout &lt;&lt; "Enter a non-negative number: ";
  cin &gt;&gt; userNumber;
  
  
  while (userNumber &gt; counter)
  {
      power +=2;
      counter++;
      power++;
  }
  
  sum = power - 1;
  // post-condition: Sum = 2^p -1
  cout &lt;&lt; "The output is " &lt;&lt; sum &lt;&lt; endl;
  return 0;
  </code></pre>