title: Conditional check for "i == (2^8)" fails when i is 512?
body: <p>Here is a small Program to print powers of 2 till 8. But it is not quitting after 8. Please explain the reason.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  int main(void)
  {
          unsigned int i=1;
          while(1) {
                  i = i&lt;&lt;1;
                  printf("i = %d\n",i);
                  if(i==(2^8))
                          break;
                  sleep(1);
          }
          printf("Exited While loop.. \n");
          return 0;
  }
  </code></pre>
  
  <p>The Loop is not Exiting when i = 2^8. My output is something like this:</p>
  
  <pre><code>i = 2
  i = 4
  i = 8
  i = 16
  i = 32
  i = 64
  i = 128
  i = 256
  i = 512 (Should have Exited here. But the program is continuing. Why?)
  i = 1024
  i = 2048
  i = 4096....
  </code></pre>
  
  <p><strong>EDIT :</strong></p>
  
  <p>Thanks for answering that ^ is an XOR operator. But now the below code is behaving strange. Please Explain.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(void)
  {
          if((2)^8 == 1&lt;&lt;8) {
                  printf("True.. \n");
          } else {
                  printf("False..!!");
          }
          return 0;
  }
  </code></pre>
  
  <p>The above function program prints true.</p>