Well, how about

Code:
int value;
int temp;
int revalue;

input value BYFM

temp = value
revalue=0
while (temp > 0)
        revalue = (revalue * 10) + (temp mod 10)
        temp = temp / 10