This week's book giveaway is in the Cloud/Virtualization forum.We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Liutauras Vilda
• Bear Bibeault
• Tim Cooke
• Junilu Lacar
Sheriffs:
• Paul Clapham
• Devaka Cooray
• Knute Snortum
Saloon Keepers:
• Ron McLeod
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• Frits Walraven
Bartenders:
• Carey Brown
• salvin francis
• Claude Moore

# Recursive Method to Convert Decimal Number into a Binary Number

Greenhorn
Posts: 2
Can someone please help me to Write a recursive method to convert a decimal number into a binary number, Printing the Binary number?

Marshal
Posts: 64115
215
• 1
Welcome to the Ranch

A recursive method is one which calls itself. If you use recursion, you make each call slightly smaller than its predecessor, and you must eventually reach a call so small that the recursion stops. That latter is called the base case.
Please show us the algorithm/formula you have been given to convert a decimal number to binary.

Saloon Keeper
Posts: 20643
122
• 2
The entry in Stan Kelley-Bootle's "The Devil's DP Dictionary for "recursion" reads as follows:

dictionary entry wrote:
recursion

See recursion

Greenhorn
Posts: 2
Hello, I'm learning java and i don't know how to write a recursive method, so i have no code written. Could you please give me a code using recursive methods to convert Decimal to Binary

Campbell Ritchie
Marshal
Posts: 64115
215

Nadun Fernando wrote:. . . Could you please give me a code using recursive methods to convert Decimal to Binary

No. We don't work like that. We expect you to try something first.

Campbell Ritchie
Marshal
Posts: 64115
215

Tim Holloway wrote:. . . The Devil's DP Dictionary for "recursion" . . .

Hahahahahahahaha!

 For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad? Create Edit Print & Convert PDF Using Free API with Java https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire