OK: x is (presumably) an integer, which means it is a collection of (say) 32 bits which make up the number: the rightmost bit is the least significant, and the left most is the most significant, and they are numbered from (normally) bit 0 to bit 31, where the index indicates the power of two that the bit holds. If you pretent taht an integer has four bits (to make it simpler to type out):
Bit 0 == 2<sup>0</sup> == zero or one
Bit 1 == 2<sup>1</sup> == zero or two
Bit 2 == 2<sup>2</sup> == zero or four
Bit 3 == 2<sup>3</sup> == zero or eight.
And you can make up the entire range of values that a (four bit) number can hold from those by adding the powers of two together:
Value B3 B2 B1 B0
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
32 bit numbers work the same way, but with a HUGE range of values!
What the question is asking you to do is to accept an integer value containing existing bits, use an integer which tells you which bit index to start at, a number of bits to play with and a second value to get "new" bits from.
So if n is 6, you want the rightmost 6 bits of y: b31, b30, b29, b28, b27, b26
and if p is 2, you want to remove the six bits of x starting with b2: b8, b7, b6, b5, b4, b3, b2 and replace them with the bits you removed from y.
It sounds complex, but it isn't, not really. Look at the AND operator "&", the OR operator "|", and the shift operators >> and << - they are all you should need for this, pretty much.