Skip to content

Instantly share code, notes, and snippets.

@AbdallaZaki
Last active September 27, 2016 05:45
Show Gist options
  • Save AbdallaZaki/9d702f7cacc24c6a5a0ee7b74ed5c8f5 to your computer and use it in GitHub Desktop.
Save AbdallaZaki/9d702f7cacc24c6a5a0ee7b74ed5c8f5 to your computer and use it in GitHub Desktop.
// https://projecteuler.net/problem=1
var getSumOfMuliples = function (n1,n2,limit){
var result=0;
for(var i=Math.min(n1,n2);i<limit;i++){
if(i%n1==0||i%n2==0){
result+=i;
}
}
return result;
}
console.log(getSumOfMuliples(3,5,1000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment