Skip to content

Instantly share code, notes, and snippets.

@dawnerd
Created March 4, 2011 00:44
Show Gist options
  • Save dawnerd/853936 to your computer and use it in GitHub Desktop.
Save dawnerd/853936 to your computer and use it in GitHub Desktop.
var f = 0, s = 1, n = 1, total = 0;
while(n < 4000000) {
n = (f+s);
f = s;
s = n;
if(!(n % 2)) total += n;
}
print(total);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment