Question: I am new to C and learning how bit-wise operator works in C.I wanted to check if most significant of an address is set or not

```
  int main()
  {

   int addr=0x0fffffff;

   if(addr&0x80)
   {
      Printf("Bit is set");
   }
    else
     printf("Bit is not set");
     return 0;
   }

```

EDIT: I Would like 0x80 to be represented as 1000 0000 0000 0000 0000 0000 0000 0000 ,I have seen such implementation in past where no need of writing all the bits using some macros but not able to recall it where?

Answer: 
In `c` every `non zero` value is `true`. So your condition will be true. 

Your condition will evaluate to `10000000b = 128 = true`
In

```
if(addr&0x80)  

```

condition `addr&0x80` holds true (returns a non zero value to `if`) and it is equivalent to 

```
if( a nonzero value) // any nonzero value treated as true

```

That's why it is printing `Bit is set`