"Create a program in Python that converts a decimal to a hexadecimal, then from hexadecimal to decimal." I have completed the decimal-to-hexadecimal conversion, but how do I get the hexadecimal back to a decimal? Code please!
def decToHexa (n): # char array to store # hexadecimal number hexadeciNum = ['0'] * 100; # counter for hexadecimal # number array i = 0; while (n != 0): # temporary variable # to store remainder temp = 0; # storing remainder # in temp variable. temp = n % 16; # check if temp < 10 if (temp < 10): hexa DeciNum[i] = chr(temp + 48); i = i + 1; else: hexadeciNum[i] = chr (temp + 55); i = i + 1; n = int(n / 16); # printing hexadecimal number # array in reverse order j = i - 1; while (j >= 0): print ((hexadeciNum[j]), end = ""); j = j - 1; # Driver Code n = 2545; decToHexa (n);