I have this code where I use "bitwise and" (&
) to try and change x
:
#include <stdio.h>
int main (void){
unsigned long x = 0;
printf("x = %lu\n", x);
x &= 1;
printf("x = %lu\n", x);
return 0;
}
I compile and execute the code in order to get output:
x = 0
x = 0
But I expected:
x = 0
x = 1
Why?