Previous solution will not work for Negative numbers.
Because when we will do right shift then it will pad it with 1 not 0. So answer will not be correct. For avoiding this we should mask. The perfect answer will be :
#define swapNibble(x) ( (x<<4) & (0xF0) | (x>>4) & (0x0F) )
** If anyone wants more explanation plz comment