Last active
September 29, 2015 04:31
-
-
Save jubishop/493789107e9416568a3a 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
puts 'What number shall we find factors for? ' | |
number_to_factor = gets.to_i | |
puts "Factors for #{number_to_factor} are:" | |
1.upto(number_to_factor) { |number_to_test| | |
if (number_to_factor % number_to_test == 0) | |
puts number_to_test | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment