write a program for bit count in a 32-bit integer number?
Posted by asadullahansari on August 21, 2008
Program should be efficient. Dont count every bit by loop…Cheers!!!!
Posted by asadullahansari on August 21, 2008
Program should be efficient. Dont count every bit by loop…Cheers!!!!
asadullahansari said
int countBit(int intVal)
{
int nCount=0;
for(nCount=0;intVal; ++nCount)
intVal=intVal & (intVal-1)
return count;
}
Give the other solution of it!!!