#include
void main()
{
void to_base_n(unsigned long , unsigned int );
unsigned long number;
unsigned int e;
printf("Enter an integer and the evolution(q to quit):\n");
while(scanf("%lu%u", &number, &e) == 2)
{
printf("Binary equivalent: ");
to_base_n(number, e);
putchar('\n');
printf("Enter another integer and evolution(q to quit):\n");
}
printf("Done!\n");
}
void to_base_n(unsigned long n, unsigned int e)
{
int r;
r = n % e;
if(n >= e)
to_base_n(n / e ,e);
printf("%d", r);
}