"""
Recursive approach
"""

# Prompt the user to input a decimal number as an integer.
decimal = int(input("Please enter the decimal representation of a number: "))

# Define a recursive function to convert a decimal number to binary.
# Arguments:
# - d: The decimal number to convert.


def int2bin(d):
    # Base case: If the number is 0, return an empty string.
    if d == 0:
        return ""
    # Recursive case: Divide the number by 2 and prepend the remainder (binary digit).
    return int2bin(d // 2) + str(d % 2)


# Compute and display the binary representation of the input number.
print(f"The binary representation of your number is {int2bin(decimal)}")
