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

Program to convert decimal to binary using recursion #3183

Closed
wants to merge 1 commit into from

Conversation

riyaa060
Copy link

Problem

There was no program related to conversion

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

Solution

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".

@riyaa060
Copy link
Author

I would appreciate it if you could add the following labels to this pull request:

  • hacktoberfest2024
  • gssoc-ext

Thank you for your consideration! I look forward to your feedback.

1 similar comment
@riyaa060
Copy link
Author

I would appreciate it if you could add the following labels to this pull request:

  • hacktoberfest2024
  • gssoc-ext

Thank you for your consideration! I look forward to your feedback.

@riyaa060 riyaa060 closed this Oct 19, 2024
@riyaa060 riyaa060 deleted the add-conversion-program branch October 19, 2024 15:40
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