Ruby - If nested statement

Description

If nested statement

Demo

age = 19 
if age < 21 # w  w w .  j  a v  a2s. co  m
 puts "You can't drink in most of the United States" 
 if age >= 18 
    puts "But you can in the United Kingdom!" 
 end 
end

Result

Related Topic