title: Can we left shift a value inside a while loop?
body: <p>I try to make use of a left shift to identify a setbit using a counter. When I try to left shift var, I found that it is stuck in an infinite loop and only zero gets printed.
  What is wrong with the following code? Is it even legitimate to make use of a left shift inside a while loop?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;limits.h&gt;
  int main(int argc, char **argv)
  {
      int var =1;
  
      while(var&lt;INT_MAX)
      {   
          var = var&lt;&lt;1;
          printf("%d\n", var);        
      }
  
      return 0;
  }
  </code></pre>