// For the nth time, a minimal decimal output routine in C. #include #include static char *basebout(char *p, int n, int b) { int quo = n / b, rem = n % b; if (quo) p = basebout(p, quo, b); *p++ = '0' + rem; return p; } int main(int argc, char **argv) { char buf[32]; *basebout(buf, atoi(argv[1]), argc < 3 ? 10 : atoi(argv[2])) = 0; printf("%s!\n", buf); return 0; }