ruby min 2 numbers

# Step 1: Prompt the user to enter the first number
print "Enter the first number: "
# Step 2: Get user input for the first number and convert it to a floating-point number
num1 = gets.chomp.to_f

# Step 3: Prompt the user to enter the second number
print "Enter the second number: "
# Step 4: Get user input for the second number and convert it to a floating-point number
num2 = gets.chomp.to_f

# Step 5: Use the ternary operator to find the minimum of the two numbers
min_num = (num1 < num2) ? num1 : num2

# Step 6: Display the minimum number
puts "The minimum of #{num1} and #{num2} is: #{min_num}"