Friday, February 10, 2017

C-Program To find SET bits

/*  C-Program To find SET bits   */
main()
{
int count,x=7;

for ( count=0; x != 0; x>>=1)
{
if ( x & 1)
count++;
}

printf("%d", count);
}

No comments:

Post a Comment