ruby and or

# Step 1: Define a method named "is_even?" that takes an integer as a parameter.
def is_even?(num)
  # Step 2: Use the modulo operator (%) to check if the integer is even.
  # If the result is 0, the number is even; otherwise, it's odd.
  return num % 2 == 0

# Step 3: Prompt the user to enter an integer and convert the input to an integer.
puts "Enter an integer:"
user_input = gets.chomp.to_i

# Step 4: Call the "is_even?" method with the user's input and store the result.
result = is_even?(user_input)

# Step 5: Output whether the entered number is even or odd based on the method result.
puts result ? "The entered number is even." : "The entered number is odd."