Simple number base convert in C