To input a decimal number and display in hex, something like:
char buffer[99];
fgets(buffer, 98, stdin);
printf("%x", aoti(buffer));
would be the required core code. Needless to say, there is no error checking, mug trapping, etc. Or if you require the hex in a char[], then replace "printf(" by "sprintf(pointer_to_bufffer,"
Chat with our AI personalities
221122: Binary = 1000100001000100100010 Octal = 10410442 Decimal = 2232610
10011101: Decimal = 157 Hexadecimal = 9D
Decimal: 170Hex: AA
Convert each group of 4 bits into one hexadecimal digit. 1010 is "A" in hexadecimal, so this particular number is "AA".
D = 13