unsigned int a = 40;
unsigned int mask = 1<<3;
unsigned int b = a | mask;
printf ("%d", b);
I have the above code and was expecting a result of 48 for b, but I get an output of 40.
if I use a mask of 1<<2 i.e 4, I get the right value of 44.
what is wrong in my code?