Convert Num to Base X -- C program