Multiples of 3 and 5

Find the sum of all the multiples of 3 or 5 below 1000.

by makilo123

JavaScript

var sum = 0;
for (var i = 0; i < 1000; i++) {
  if (i % 3 === 0 || i % 5 === 0) {
    sum += i;
  }
}
console.log('Sum: %d', sum);