adplus-dvertising
frame-decoration

Question

The following 'C' program
{
unsigned int num;
int c=0
scanf("%u",#);
for(;num;num>>=1)
{
if(num &1)
c++;
}
printf("%d",c);
}

a.

Counts the number of bits which are on in the number num

b.

Sets all bits in the number num to 1

c.

Sets bits in the number num to 0

d.

Error

Posted under C Programming

Answer: (a).Counts the number of bits which are on in the number num

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. The following 'C' program