How to Reverse a hexadecimal number using bitwise?

Answer:

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);

}

First answer by ID3418658251. Last edit by ID3418658251. Question popularity: 2 [recommend question].