Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python Program to Convert Decimal to Binary Using Recursion #7827

Closed
wants to merge 1 commit into from

Conversation

riyaa060
Copy link

Overview: This pull request introduces a new Python program that converts a decimal number to its binary representation using a recursive approach.

Changes Made:

  • Added a new Python file named decimal_to_binary.py containing the recursive function for conversion.

** Code Explanation:** The program defines a recursive function that takes a decimal number as input and returns its binary representation. The function works by repeatedly dividing the number by 2 and concatenating the remainder, effectively building the binary string.

Example: For example, calling decimal_to_binary(42) will return "101010".

Related Issues
This PR fixes issue #7814

@riyaa060 riyaa060 closed this Oct 19, 2024
@riyaa060 riyaa060 deleted the decimal-to-binary branch October 19, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant