def convert(num):
          hexa = []
          while num != 0:
              rem = num % 16
              if rem < 10:
                  hexa.append(chr(rem + 48))
              else:
                  hexa.append(chr(rem + 55))
              num = num // 16
          hexa.reverse()
          return ''.join(hexa)
      decimal = 2545
      print("Hexadecimal :", convert(decimal))
      

      Python language logo
      Decimal to Hexadecimal Conversion

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.