Write a single line of code for the below operations

1. Set the nth bit to 1.

x = x | (1 << n);

2. Reset the nth bit of number

x = x & ~(1 << n);

3. Toggle the nth bit of the number.

x = x ^ (1 << n);

4. Convert the (right adjusted) n-bit field of x that begins at position p x =(x >> (p+1-n)) & ~(~0 << n);

An important point to note is that none of your operation should overflow the variable in use.

1. Set the nth bit to 1.

x = x | (1 << n);

2. Reset the nth bit of number

x = x & ~(1 << n);

3. Toggle the nth bit of the number.

x = x ^ (1 << n);

4. Convert the (right adjusted) n-bit field of x that begins at position p x =(x >> (p+1-n)) & ~(~0 << n);

An important point to note is that none of your operation should overflow the variable in use.