Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

trailing zeros in factorial js

function zeros (n) {
  let cont = 0;
  while(n > 0){
    n = Math.floor(n/5);
    cont += n
  }
  return cont;
}
 
PREVIOUS NEXT
Tagged: #trailing #zeros #factorial #js
ADD COMMENT
Topic
Name
7+2 =