Ruby - If nested statement

Description

If nested statement

Demo

age = 19 
if age < 21 # www  .  j av a  2s  .com
 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