Choose the correct statement for the following code segment?
bool check (int N)
{
if( N & (1 << i) )
return true;
else
return false;
}
bool check (int N)
{
if( N & (1 << i) )
return true;
else
return false;
}
A. function returns true if N is odd
B. function returns true if N is even
C. function returns true if ith bit of N is set
D. function returns false if ith bit of N is set
Answer: Option C
Join The Discussion