Possible Duplicate:
How to check if a number is a power of 2
I made the following code but its not working.The compiler gives an error that for missing ) and expression syntax error.I would also like to know how will the operators proceed?From left to right or right to left?
#include <stdio.h>
#include <limits.h>
#include <math.h>
int main()
{
int i,x=256,y,flag;
for(i=0,flag=0,y=1;y<INT_MAX;if(flag)break,if(flag)printf("YES"),if(y==x)flag=1,i++,y=pow(2,i));
return 0;
}