C program to print a vertical english ruler whose length is given by the user
The task you are solving is quite simple. So I don't think there's any great change possible. Here are a few things:

You might want to consider accepting command-line parameters (argc and argv) to determine the number of dashes and the dash height.

Your variables are poorly named, and not initialized. You have not specified an old version of C, so I'm assuming that you can write to at least the 1999 C standard (known as &quot;C99&quot;).

You don't validate your user's input.

You don't need to return 0 from main(). Just &quot;fall off the end&quot; of the function and it will do that automatically.

Your last two calls to printf should be merged.

You might want to write functions (or preprocessor macros) to make the various fractional gradations more clear:
#define DRAW_1_8(HEIGHT) for (int i = 0; i &lt; (HEIGHT) - 3; ++i) printf(&quot;-&quot;)


then your main loop becomes a series of named statements:
for (int inch = 0; inch &lt; length; ++inch) {
    DRAW_INCH(height, inch);
    DRAW_1_8(height);
    DRAW_1_4(height);
    DRAW_1_8(height);
    DRAW_1_2(height);
    DRAW_1_8(height);
    DRAW_1_4(height);
    DRAW_1_8(height);
}
DRAW_INCH(height, length);

This does serve to make the code a bit clearer, but mainly it serves to reduce repetition. I'll bet there were a few mistakes early on as you adjusted all the n - K parameters, and macros or functions address that issue.