#include "compte_bits.h" int compte_bits(unsigned long mot) { int nombre = 0; for (;;) { if (mot == 0) return nombre; if ((mot & 0x1) == 1) nombre++; mot = mot >> 1; } }