printf
doesn't automatically include a trailing newline, and it doesn't generally flush the output buffer until it outputs a newline; so probably you just need to add a
printf("\n");
at the end of your program, just before your return 0;
.
Alternatively, or additionally, if you want to see the output as-you-go (if BSP allows that), you can add a
fflush(stdout);
right after your printf("%d, ",primes[i]);
, to explicitly flush the output buffer.