printf("n & -n=%d\n",n & (-n));//n=2 means 0000 0010 & n=-2 means internally it will take -ve no. as its 2's complement....means invert 2 +1 ....2=0000 0010 ~2=1111 1101 ....~2+1=1111 1110..when it is made bitwise & with 2...i.e.///
//1111 1110 & 0000 0010=0000 0010....so answer is 2..//
//BCZ & MULTIPLIES THE BITS//
if((n & -n)==n)//2 & -2 ==2
printf("I AM RIGHT\n");//CONDITION WILL BE TRUE//
else
printf("YOU ARE WRONG\n");
if((n & (1-n))==n)
printf("1-N TRUE\n");//CONDITION IS TRUE BCZ,,,n=2 & (1-2)=-1 it takes 2's complement of -ve value ...so ~1+1=-1
//~1=1111 1110 ~1+1=1111 1110+1=1111 1111.....so this 1111 1111 & 2= 1111 1111 & 0000 0010=0000 0010..bcz it multiplies the bits..so ((2 & (1-2))==2) is true
else
printf("FALSE\n");
if((n & 1-n)==n)//CONDITION WILL BE FALSE ..BCZ PRIORITY OF '==' SIGN IS MORE THAN '&' OPERATOR....//