Włącz pierwsze N ​​bity

unsigned int set_bits(unsigned int n, unsigned int m) {
unsigned int mask = (1 << m) - 1;
return n | mask;
} 
Mero