I did java a long time ago and i'm sure this is not the same language but to reverse the digits you would:
read in digits as a string
run a loop backwards (start at max length (make sure the digits are a string), and -1 from length)
combine the chars into a string
convert back to integer if...