Created
February 20, 2012 17:03
-
-
Save kendhia/1870126 to your computer and use it in GitHub Desktop.
The solution of the first problem in "Project Euler" using JavaScript !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var max = 1000; | |
var result = 0; | |
function TheSum() { | |
for (i = 0; i<max; i++) { | |
if (i % 3 === 0 || i % 5 === 0) { | |
result += i; | |
console.log(result) ; | |
} | |
} | |
} | |
TheSum(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment