Q:

How to display ascending numbers and descending beside it using for loop in c

I've been into this problem lately, and I just ca't figure out how. I wan't an output to be like this:
Enter Number: 5

1      5
2      4
3      3
4      2
5      1

And here's my code:
int c;
int n;
int i;
printf("Enter Number Count Limit: ");
scanf("%d",&n);

for (c=1;c<=n;c++)
{
    for (i=c;i<0;i--)
    {
        printf("%d\t%d",c,i);
    }
    printf("\n");
}
return 0;

Can Anyone please tell me whats wrong with my code. It has no errors and it has an empty output. Thank You!

A:

I do not thing there's a reason to use 2 for loops. I would go with something like this:      
for (c=0; c<n; c++){
         printf("%d\t%d\n", c+1, x-c);
      }

