Не нужно здесь длинной арифметики, обычное деление в столбик.
void divide(int num, int div) {
int quot, rest, pos;
int positions[1000];
char out[1024];
printf("%d / %d = ", num, div);
for (pos = 0; pos < 1000; pos++)
positions[pos] = -1;
quot = num / div;
rest = num % div;
pos = sprintf(out, "%d", quot);
if (rest)
out[pos++] = '.';
while (positions[rest] == -1 && rest) {
positions[rest] = pos;
num = rest * 10;
quot = num / div;
rest = num % div;
out[pos++] = quot+'0';
}
out[pos] = 0;
if (rest == 0)
printf("%s\n", out);
else
printf("%.*s(%s)\n", positions[rest], out, out+positions[rest]);
}