Find the number of digits
let digits_num = Math . floor ( Math . log ( N ) / Math . log ( 10 ) + 1 ) ; let temp_sum = 0 ; let temp = digits_num ; let result ; let X , var1 ; let sum = 0 ; let num2 = N ;