K&R C Exercise 2-6: setbits — Set n Bits at Position p
K&R C Exercise 2-6 — setbits(x, p, n, y) Exercise 2-6: Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged. Approach K&R numbers bit positions from the right starting at 0, so bit 0 is …