Skip to content

Instantly share code, notes, and snippets.

@masterots
Last active August 29, 2015 14:20
Show Gist options
  • Save masterots/bd1159c2ad4b369a797c to your computer and use it in GitHub Desktop.
Save masterots/bd1159c2ad4b369a797c to your computer and use it in GitHub Desktop.
project euler 1 : multiples of 3 and 5
var sum = 0;
for (var i = 0; i < 1000; i++) {
sum += i % 3 === 0 ? i : 0;
sum += i % 5 === 0 ? i : 0;
}
console.log(sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment