functional programming – C program to print a vertical english ruler whose length is given by the user

In this source code, i have writena program, using for loops, to print an english ruler whose length is given by the user.
So what i want to know is that is it possible to modify this program, to print the ruler in a more logical way And if so, how can it be done, without applying reculsions ?

This is the program to print ruler vertically.

#include<stdio.h>
int main()
{
int q,num,x;
int y,p,n;
printf("Enter height of central dashesn");
scanf("%d",&n);
printf("Enter number of inchesn");
scanf("%d",&num);
for(x=0;x<num;x++)
{
for(q=0;q<n;q++)
{
printf("-");
}
printf("%dn",x);
for(p=0;p<n-3;p++)
{
printf("-");
}
printf("n");
for(p=0;p<n-2;p++)
{
printf("-");
}
printf("n");
for(p=0;p<n-3;p++)
{
printf("-");
}
printf("n");
for(p=0;p<n-1;p++)
{
printf("-");
}
printf("n");
for(p=0;p<n-3;p++)
{
printf("-");
}
printf("n");
for(p=0;p<n-2;p++)
{
printf("-");
}
printf("n");
for(p=0;p<n-3;p++)
{
printf("-");
}
printf("n");
}
for(y=0;y<n;y++)
{
    printf("-");
}
printf("%d",x);
printf("n");
return 0;
}

This is the output for vertical ruler