C Programming - Bitwise Operators - Discussion
|
|
|
|
Read more:"No one is as deaf as the man who will not listen."
- (Proverb)
|
| 4. |
Bitwise & can be used to check if more than one bit in a number is on. |
Answer: Option A
Explanation:
No answer description available for this question.
|
|
Sreejith said:
(Wed, Sep 7, 2011 07:07:30 PM)
|
|
| |
| Could anyone please explain me the answer? |
|
Datta said:
(Wed, Oct 5, 2011 10:03:30 AM)
|
|
| |
| 1+1=1 |
|
Divya said:
(Sat, Oct 29, 2011 02:31:43 PM)
|
|
| |
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:
(Sun, Oct 30, 2011 10:28:36 PM)
|
|
| |
| Bitwise operator is used for check one bit in a number is on or off both. |
|
|