Skip to content

Instantly share code, notes, and snippets.

@mrandyclark
Created January 11, 2011 21:24
Show Gist options
  • Save mrandyclark/775178 to your computer and use it in GitHub Desktop.
Save mrandyclark/775178 to your computer and use it in GitHub Desktop.
# If you put in a beginning year and an end year, it should spit out a list of
# all of the leap years in between.
puts 'Hello. What year would you like to begin with?'
@start_year=gets.chomp
puts 'What year would you like to end with?'
@end_year=gets.chomp
input=''
while @start_year < @end_year
puts @start_year
puts @start_year%4
if @start_year%4 == 0
puts @start_year
@start_year++
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment