I need to find out the mask value with respect to the number provided by the user.
For example. If user provides input as
22 (in binary 10110)
and then I need to find the mask value by changing the high bit of the input as 1 and rest to 0.
So in this case it should be:
16 (in binary 10000)
Is there any inbuilt method in c language to do so.