You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
191 B
16 lines
191 B
13 years ago
|
[1, 2, 3].each { |i| puts i }
|
||
|
|
||
|
[1, 2, 3].each do |i|
|
||
|
if i % 2 == 0
|
||
|
puts "#{i} is even."
|
||
|
else
|
||
|
puts "#{i} is odd."
|
||
|
end
|
||
|
end
|
||
|
|
||
|
1.upto 3 do |x|
|
||
|
puts x
|
||
|
end
|
||
|
|
||
|
1.upto(3) { |x| puts x }
|