DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR CPP
count number of bits set in a number
int count_one (int n) { while( n ) { n = n&(n-1); count++; } return count; }
Source by www.hackerearth.com #
PREVIOUS
NEXT
Tagged:
#count
#number
#bits
#set
#number
ADD COMMENT
Topic
COMMENT
Name
6+5 =
Submit