#include #include #include uintmax_t i = 3, j; // only tested with clang or similar tools int main(int argc, char*argv[]) { if (argc > 1) i = atoi(argv[1]); for (; i < UINTMAX_MAX; i += 2) { for (j = 3; j < i; j += 2) if (i % j == 0) goto retry; printf("%ju\r", i); retry:; } }