Skip to content

Instantly share code, notes, and snippets.

@Softwave
Last active December 18, 2015 22:38
Show Gist options
  • Save Softwave/5855442 to your computer and use it in GitHub Desktop.
Save Softwave/5855442 to your computer and use it in GitHub Desktop.
/* Seeing if I can complete the first project euler problem with
javascript and node.js */
var sum = 0;
var r;
var r2;
for (var i = 0;i < 1000;i++) {
r = i % 3;
r2 = i % 5;
if ((r == 0) || (r2 == 0)) {
sum += i;
}
}
console.log('%d \n', sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment