Ruby for Instance / If Else

# Define a variable
x = 10

# Use the if statement to check if x is greater than 5
if x > 5
  puts "x is greater than 5"
elsif x == 5
  puts "x is equal to 5"
else
 puts "x is not greater than 5"
end

Try on playground

Next: switch

made with by dfxe / source / license