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:
Example-1
Input: num = 10, base = 2
Output: 1010
Example-2
Input: num = 255, base = 16
Output: FF
Example-3
Input: num = 0, base = 2
Output: 0
Input
10 2
Expected Output
1010