Created
November 6, 2015 15:38
-
-
Save kylekeesling/4523d06719e6284cc80f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(1..1000).each do |number| | |
if number % 7 == 0 | |
puts "#{number} is divisible by 7" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example uses the each loop on a range to find all numbers between 1 and 1000 that are divisible by 7