title: Determine if an int is a power of 2 or not in a single line
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2">How to check if a number is a power of 2</a>  </p>
  </blockquote>
  
  
  
  <p>I made the following code, but it's not working. The compiler gives an error that for a missing <code>)</code> and expression syntax error. What is the the procedence of the operators? From left to right or right to left?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;limits.h&gt;
  #include &lt;math.h&gt;
  int main()
  {
      int i, x = 256, y, flag;
      for (i = 0, flag = 0, y = 1; y&lt;INT_MAX; if (flag) break, if (flag) printf("YES"), if(y == x) flag = 1, i++, y = pow(2,i));
      return 0;
  }
  </code></pre>