Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript factor chain

function calculate(num) {
    var str = "0";
    for (var i = 1; i <= num; i++) {
        if (num % i == 0) {
            str += ',' + i;
        }
    }
    alert(str);
}

calculate(232);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #factor #chain
ADD COMMENT
Topic
Name
7+1 =