count bit 1 c++ code example Example: count bit 1 c++ returns the number of set bits in a integer. cout<< __builtin_popcount (11); //1011 //Ouput: 3