bitwise calculation

in the video of ternary operators, when n&1 is kept under condition to print odd and even, how’s this calculation done for any n?