Right shifting 1 by 8, 16 or 24 times isn't going to get you anywhere. After a single right shift, the number will become 0 and 'AND'ing it with any number would make no difference. Oh and BTW, 0XF is the same as 0XFF or 0XFFFFFFFF.
Try something like:
int main()
{
int x,y,z, i = 16;
x = (unsigned char) (i >> 2 & 0xff );
y = (unsigned char) (i >> 3 & 0xF );
z = (unsigned char) (i >> 4 & 0xFFFFFFFF );
cout << "Original number: " << i << '\n';
cout << "x=" << x << endl;
cout << "y=" << y << endl;
cout << "z=" << z << endl;
getchar();
}