There are many methods to check a particular bit is set or not.
Method 1:
Suppose I want to check in a given number 3rd bit is set or not.
int num = 10;
int temp ;
temp = num;
temp = temp >> 3
if (temp & 1)
{
3rd bit is set;
}
else
{
3rd bit is not set;
}
Method 2:
int num = 10;
if (num & 0x4)
{
3rd bit is set;
}
else
{
3rd bit is not set;
}