& : Bitwise AND operator
| : Bitwise OR operator
int foo(int n)
{
return n & n | 1;
}
return n & n | 1;
here precedence of &>| so n&n will be executed 1st.
n&n = n
Now, n|1 which is nothing but n+1 for even n (least bit 0) and n for odd n.
For foo(10), 11 will be output.