94. Convert Decimal Number to Binary or Hex Without itoa function
In firmware development, you might need to convert numbers to binary or hexadecimal strings manually — for instance, sending over UART or displaying on an LCD — without using standard library functions like itoa().
Your task is to:
Read an unsigned integer num and a base (2 or 16)
Print the number in the given base as a string
You must not use any standard string conversion like itoa() or sprintf()