using modulus and division...
1st
n = (39%10)
m = 9
n = (39/10)
n = 3 truncate decimal places
if n != 0 then m x 10
m = 9 x 10 = 90
else m = 9
2nd
n = (3%10)
m = 3
n = (3/10) = 0
if n!=0
m = 3 x 10 = 30
else m = 3
repeat the same process until n/10 = 0
sum all value m 90+3 = 93