def convertBinary(num):
          binaryArray = []
          while num>0:
              binaryArray.append(num%2)
              num = num//2
          for j in binaryArray:
              print(j, end="")
      decimal_num = 21
      convertBinary(decimal_num)
      
      Python language logo

      Decimal to binary conversion

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.