Write a program that converts decimal numbers to hexadecimal, i.e., from base 10 to base 16.
Input will consist of several lines each with a decimal number d of up to 9 decimal digits.
For each line of input, output should contain a line with the hexadecimal representation of the corresponding input number. The hexadecimal digits representing quantities from 0 to 15 should be: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f. Letters should be given in lowercase.
10 16 12648430 2989
a 10 c0ffee bad
Remember the characters
'9' are different
than the numeric values
You can create a function which converts between both
by using an
try first: dec2bin
try also: hex2dec
try next: base2base
Copyright © 2020-2023 Rudy Matela
All rights reserved