I'm trying to check a particular bit of a long long integer
long long int val=23355665641326;
int bit_no=32;
if( (val & (1<<bit_no)) == 0)
cout<<bit_no<<"'th bit is not set\n";
else
cout<<bit_no<<"'th bit is set\n";
the binary equivalent of 23355665641326
is -
101010011110111101010001001110110111101101110
^
we see, 32'th bit is set. But my code returns not set :(
how can i check the bit?