C Programming - Bitwise Operators - Discussion

4. 

Bitwise & can be used to check if more than one bit in a number is on.

[A]. True
[B]. False

Answer: Option A

Explanation:

No answer description available for this question.

Sreejith said: (Sep 7, 2011)  
Could anyone please explain me the answer?

Datta said: (Oct 5, 2011)  
1+1=1

Divya said: (Oct 29, 2011)  
Checking if more than one bit in a number is on, is nothing but counting no:of 1s in a number..

int c=0;
for(;num;num>>=1)
{ if (num & 1)
c++;
}
printf(" no:of bits on=%d",c);

Asif Ali said: (Oct 30, 2011)  
Bitwise operator is used for check one bit in a number is on or off both.

Satya said: (Jul 18, 2015)  
We have to follow & truth table: 1 & 11111111 then we get 1.

Pavan said: (Sep 3, 2020)  
Thanks for explaining @Divya.

Shreedevi said: (Jan 7, 2021)  
1 & 1 = 1.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.