def reverse_string(input_string):
    reversed_string = ""
    for i in range(len(input_string) - 1, -1, -1):
        reversed_string += input_string[i]
    return reversed_string

# Prompt the user to enter a string
user_input = input("Enter a string: ")

# Reverse the string using the custom function
reversed_result = reverse_string(user_input)

# Print the reversed string
print("Reversed string:", reversed_result)
