def convertToBinary(n):
   """Function to print binary number
   for the input decimal using recursion"""
   if n > 1:
       convertToBinary(n//2)
   print(n % 2,end = '')

# decimal number
dec = 34

convertToBinary(dec)

 

相关文章:

  • 2022-12-23
  • 2021-04-13
  • 2022-01-09
  • 2021-08-11
  • 2022-12-23
  • 2021-11-17
  • 2021-04-18
  • 2021-12-23
猜你喜欢
  • 2021-05-18
  • 2022-12-23
  • 2021-12-25
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案