ruby pop array

# Create an array
my_array = [1, 2, 3, 4, 5]

# Use the pop method to remove and return the last element of the array
popped_element = my_array.pop

# Print the popped element
puts "Popped element: #{popped_element}"

# Print the modified array after the pop operation
puts "Modified array: #{my_array}"