### SETBITS(x,p,n,y) – C program to set n bits of x from pth position to the rightmost n bits of y !

This article will explain about SETBITS(x,p,n,y). Example: Given: x = 170(10101010), p = 4, n = 3, y = 39(00100111) – 3 bits from 4th position in x is replace by last 3 bits of y, Hence the value of x = 186(10111010). Logic: 1. Reset the bits that has to be replaced in x […]