I have an integer input of 1991. How do I convert the input to 0x1991 instead of 7C7? I already wrote the code to convert the hex to decimal(the answer will be 6545)
int ui = 0x202;
int BCD(int value) //Converting 0xhex to decimal
{
int result = 0;
result <<= 4;
result |= ui % 10;
ui /= 10;
return value;
}