Created
April 21, 2015 15:34
-
-
Save ninjs/45d14c6c21e0043f5fc7 to your computer and use it in GitHub Desktop.
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
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