Skip to content

Instantly share code, notes, and snippets.

@abishekk92
Created May 18, 2012 07:12
Show Gist options
  • Save abishekk92/2723726 to your computer and use it in GitHub Desktop.
Save abishekk92/2723726 to your computer and use it in GitHub Desktop.
Fibonacci
a,b=0,1
sum=0
until a >= 4000000
a,b=b,a+b
if a <= 4000000 && a.even?
sum+=a
end
end
print sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment