Skip to content

Instantly share code, notes, and snippets.

@ninjs
Created April 21, 2015 15:34
Show Gist options
  • Save ninjs/45d14c6c21e0043f5fc7 to your computer and use it in GitHub Desktop.
Save ninjs/45d14c6c21e0043f5fc7 to your computer and use it in GitHub Desktop.
puts("What is the first number?")
first_num = gets.to_f
puts("What is the second number?")
second_num = gets.to_f
puts("What is the max number?")
max_num = gets.to_f
puts "\n"
puts "Your values are:"
sum = 0
(1...max_num).each do |i|
if i % first_num == 0 || i % second_num == 0
sum += i
puts sum
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment