Skip to content

Instantly share code, notes, and snippets.

@jbynum
Created January 5, 2011 17:04
Show Gist options
  • Save jbynum/766596 to your computer and use it in GitHub Desktop.
Save jbynum/766596 to your computer and use it in GitHub Desktop.
total = 0
(0...1000).each do |i|
total += i if (i%3 == 0 || i%5 == 0)
end
puts total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment