Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Number of trailing zeros of N!

function zeros (n) {
 
  let count =0
  while(n !== 0){
    count += Math.floor(n/5)
    n/=5
  }
  return count
}

  console.log((zeros(5)))

 
PREVIOUS NEXT
Tagged: #Number #trailing #zeros
ADD COMMENT
Topic
Name
1+4 =