title: What is n= n ^1U<<i?
body: <p>The problem I am facing here is to understand the change in the value of <code>n</code> in each iteration of the loop.<br />
  If you explain it by taking 2-3 iteration that will be awesome.
  correction -return value should be of 32 bit ....which is altering all bits 0-&gt;1 ans 1-&gt;0 .</p>
  <pre><code>long fun(long n)
  {
      for(int i = 0; i &lt; 32; i++)
          n = n ^ 1U &lt;&lt; i;
      return n;
  }   
  </code></pre>