Skip to content

Instantly share code, notes, and snippets.

@zeitan
Created July 30, 2016 18:06
Show Gist options
  • Save zeitan/97420d94a2e45aa186ad38da0b62a67f to your computer and use it in GitHub Desktop.
Save zeitan/97420d94a2e45aa186ad38da0b62a67f to your computer and use it in GitHub Desktop.
function multiples3And5(number) {
var count = 0
for ( var i = 1; i < number; i++) {
if (i % 3 == 0 || i % 5 == 0) {
console.log("multiple:" + i)
count += i
}
}
console.log("sum_multiiples:" + count)
}
multiples3And5(1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment