Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

decimal to binary

# Function to print binary number using recursion
def convertToBinary(n):
   if n > 1:
       convertToBinary(n//2)
   print(n % 2,end = '')

# decimal number
dec = 34

convertToBinary(dec)
print()
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #decimal #binary
ADD COMMENT
Topic
Name
4+5 =