Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Number Of Factors

function countFactors(num)
{
var finalEnd = num/2;
var count = 1;

for(var i=1; i<=finalEnd; i++)
{
if(num%i==0)
{
count++;
}

}
return count;

}


console.log(countFactors(24));
 
PREVIOUS NEXT
Tagged: #Number #Of #Factors
ADD COMMENT
Topic
Name
9+2 =