Last active
August 29, 2015 13:57
-
-
Save AzureKitsune/910c0006391a1ec32be4 to your computer and use it in GitHub Desktop.
Print Factors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printPossibleFactors(number, maxNumber) { | |
for(var i = 0; i < maxNumber; i++) { | |
if ((number/i) == Math.round(number/i)) { | |
console.log(number/i + " * " + i + " | Sum: " + ((number/i) + i)); | |
} | |
} | |
} | |
printPossibleFactors(40, 100); //get all factors for 40 up to 100. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment