Loading, please wait...

Decimal to Binary

To Convert Decimal to Binary Using Recursion

 

Code:

def convertToBinary(n):
if n > 1:
convertToBinary(n//2)
print(n % 2,end = '')
dec = 34
convertToBinary(dec)

 

Then, Click on the run button to execute it.