While19. An integer N (> 0) is given. Using the integer division and taking the remainder of the division operations, find the number obtained by reading the number N from right to left.

Solution in Python 3:

import random

N = random.randrange(1,10000)
print("N = ",N)
q = N
s = 0
while q >= 1:
r = q % 10
q = int(q/10)
s = s*10 + r

print("New number:",s)