title: g++ says: warning: statement has no effect for shift bits operators
body: <p>I'm implementing the alkhwarizmi algorithm.<br/>
  It's right but my g++ compiler doesn't like the shift operators: >> and &lt;&lt; or I'm doing something wrong.<br/>
  When I compile it, I get this output:</p>
  
  <pre><code>&gt; g++ -Wall  -std=c++0x -o "Al-khwarizmi algorithm.o" "Al-khwarizmi algorithm.cpp" (in directory: /home/akronix/workspace/Algorithms)
  &gt; Al-khwarizmi algorithm.cpp: In function ‘int alkhwarizmi(int, int)’: Al-khwarizmi algorithm.cpp:31:9: warning: statement has no effect
  &gt; [-Wunused-value] Al-khwarizmi algorithm.cpp:34:9: warning: statement
  &gt; has no effect [-Wunused-value] Compilation finished successfully.
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>int alkhwarizmi(int x, int y)
  {
      int sum = 0;
      while (x&gt;0)
      {
          if (x%2)
              sum+=y;
          //y *= 2;
          y &lt;&lt; 1;
          cout &lt;&lt; y &lt;&lt;endl;
          //x /= 2;
          x &gt;&gt; 1;
          cout &lt;&lt; x &lt;&lt;endl;
      }
      return sum;
  }
  </code></pre>
  
  <p>if I use the commented statements (straightforward multiplication and division), everything works fine.</p>