Working on an assignment that asks to rewrite all basic arithmetic operations(add/subtract/multiply) only using the bit-wise operators. One of the incomplete methods has the following description " returns the integer whose binary representation is the same as that of i in reverse. " I've successfully rewritten the add(),subtract() and multiply functions, but need suggestions as to how approach this one. As of right now this is all I have..
unsigned int reverse(unsigned int i)
{
{
int reverse;
while (i != 0)
{
reverse = reverse * 10;
reverse = reverse + i%10;
i = i/10;
}
return i;
}
}