Last active
March 5, 2016 20:28
-
-
Save jamc92/c2f6c7082402e009f428 to your computer and use it in GitHub Desktop.
Find numbers divisibles by 2, 3 y 5
This file contains 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 findDivisor() { | |
var numbers = []; | |
var number = 100000; | |
while (numbers.length < 6) { | |
for (var i = 0; i < 6; i++) { | |
if (number % 2 == 0 && number % 3 == 0 && number % 5 == 0){ | |
var divisor = numbers.push(number); | |
} | |
number++; | |
} | |
} | |
console.log(numbers); | |
} | |
findDivisor(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment