Skip to content

Instantly share code, notes, and snippets.

@q0rban
Forked from sirkitree/01.js
Created April 10, 2012 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save q0rban/2351834 to your computer and use it in GitHub Desktop.
Save q0rban/2351834 to your computer and use it in GitHub Desktop.
Project Euler challenge #1
// Project Euler challenge #1
// https://projecteuler.net/problem=1
var ans = 0;
for (i = 1; i < 1000; i++) {
if (i % 3 === 0 || i % 5 === 0) {
ans += i;
}
}
console.log(ans);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment