<< Home
Links
Technical Discussion
Complete Links
Packium->Kirukkal
Packium->Cool/Fun
Packium->Storie s
Packium->photo s
Packium->hindib logs
Packium->Techy< /a>
Packium-> Tips
Packium-> Samayal
Previous Posts
Count the number of bits set in an unsigned integer.
E-Books for IT professionals
Embedded stuffs .....
how? y?
Priority Inversion
Technical discussion in yahoo chat - STB
about ARM7TDMI
Sunday, January 30, 2005
Tuesday, February 01, 2005
Wednesday, July 13, 2005
Friday, October 14, 2005
Monday, November 06, 2006
Technical Discussion
Monday, November 06, 2006
Count the number of bits set in an unsigned integer.
/*
Program to count no. of bits in an unsigned integer
- C Language
*/
#include
#include
void main( void )
{
unsigned int a = 15;
int count = 0;
while( a )
{
++count;
a = a & ( a - 1 );
}
clrscr();
printf( "Count is %d\n", count );
getch();
}
posted by Star @ 4:01 AM
0 comments