Answer:
Written in Python:
inputnum = int(input("User Input: "))
outputnum = 0
total = 0
while(inputnum>0):
remainder = inputnum % 10
outputnum = (outputnum * 10) + remainder
inputnum = inputnum//10
total = total + remainder
print("Reverse: "+str(outputnum))
print("Total: "+str(total))
Explanation:
This prompts user for input
inputnum = int(input("User Input: "))
This initializes the reverse number to 0
outputnum = 0
This initializes total to 0; i.e. sum of each digit
total = 0
The following iteration gets the reverse of user input
while(inputnum>0):
remainder = inputnum % 10
outputnum = (outputnum * 10) + remainder
inputnum = inputnum//10
This adds each digit of user input
total = total + remainder
This prints the reversed number
print("Reverse: "+str(outputnum))
This prints the sum of each digit
print("Total: "+str(total))