Computer Science, asked by bharti12412, 3 months ago

Write a program to input a number and display the new number after reversing the digits of the original number. The program also displays the absolute difference between the original number and the reversed number.
Sample input : 123
Sample output : 321
Absolute difference : 198 in java

Answers

Answered by dhruvgandhi200
0

Answer:

num = int(input())

rev = 0

while num > 0:

 rem = num % 10  # Finding the remainder

 rev = (rev*10) + rem

 num = num//10  # Finding the quotient

print("%d " %rev)

Similar questions