Categories: archive |code

Project Euler #1

In JavaScript:

var total = 0;
for (var i = 0; i < 1000; i++){
  if ((i % 3 === 0) || (i % 5 === 0)){
    total += i;
  }
}
document.write(total);

on GitHub