Print out all possible sizes of subsequences of string in C
Here's a way that (at least IMO) at least marginally cleaner:

#include &lt;stdio.h&gt;

int main(int argc, char const *argv[])
{

    char s[] = "abcdefghijk";
    int n = sizeof(s);

    for (int k = 1; k &lt; n; k++)
    {
        for (int i = 0; i &lt; n - k; i++)
        {
            printf("%*.*s, ", k, k, s + i);
        }
        printf("\n");
    }

    return 0;
}


As to things about the code that can be improved, the most obvious would be using sizeof (or strlen, if necessary) to find the length of the input array, instead of hard-coding it.

Realistically, there's probably not a lot you can do to improve speed/performance--it's virtually guaranteed to be heavily I/O bound (though Tom Ernack's suggestion of using fwrite instead of printf might help--then again, depending on the standard library you're using, it might not).