Created
January 7, 2015 04:34
-
-
Save gingeleski/bcca5501ee81ab977348 to your computer and use it in GitHub Desktop.
Determines whether a given integer is a palindrome.
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
# Determines whether a given integer is a palindrome | |
print "Integer: " | |
number = gets.chomp.to_s | |
if number.eql? number.reverse | |
print "\nThis number is a palindrome." | |
else | |
print "\nThis number is not a palindrome." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment