Last active
December 16, 2015 07:19
-
-
Save banister/5398088 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
print "Enter a count: " | |
count = gets.chomp.to_i | |
values = [] | |
count.times do | |
print "Enter a value: " | |
values << gets.chomp.to_i | |
end | |
values.each do |value| | |
puts value | |
end | |
#Expected Output: | |
#Enter a count: 3 | |
#Enter a value: 1 | |
#1 | |
#Enter a value: 2 | |
#2 | |
#Enter a value: 3 | |
#3 | |
#1 | |
#2 | |
#3 | |
# | |
#Actual Output: | |
# | |
#Enter a count: 3 | |
#Enter a value: 1 | |
#1 | |
#Enter a value: 2 | |
#2 | |
#Enter a value: 3 | |
#3 | |
#0 | |
#0 | |
#0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment