How to Reverse a hexadecimal number using bitwise?

main()

{

int num=0xABCD;

printf("%x\n",num);

int rev=0x0;

int digit=0x0;

while(num!=0x0)

{

digit=num%0x10;

rev = rev*0x10 +digit;

num=num/0x10;

}

printf("%x\n",rev);

}