Skip to content

Conversation

AlessandroVerzella
Copy link
Collaborator

The aim of this exercise is to convert a non-negative number to a binary number using recursion.

In the decimal-to-binary function, the base case is represented by the user number, which is 0 or 1.

The recursive step is to divide the user number by 2 until the last number obtained is either 0 or 1. The remainder of the division by 2 to the end of the resulting string must be added to the recursive function.

Outside the function, I have also included the case where the user enters a negative number.

@aleattene aleattene changed the title 002-recursive-decimal-to-binary feat(m3): add solution exe 002-recursive-decimal-to-binary Aug 22, 2024
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.

2 participants