Hi!

I want to print out a 'X' with as many rows, as an input-value would have.
This picture will describe hopefully better, what I want to do:

Screenshot - 0781ad21c51043868573c8ecc3b4b448 - Gyazo

I have broken this task down in
a.) at first I only consider for n being an odd integer value.
b.) At first I do row 1 - 4 (basically a 'V' sign, we could say).

My code so far:

Code:
#include <stdio.h>

int main() {
    int i, j, n;
    scanf("%d", &n);


    for (i = 0, j = n - 2 ; i <= (n/2), j >= -1; i++, j = j - 2) {
        printf("%*s", i, "");
        printf("*");
        printf("%*s", j, "");
        printf("*\n");
    }


     return 0;
}

Also I have another fundamental question:
When I would nest a for loop in another one, then the outer loop makes one iteration and arrives in the inner loop.
The inner loop now finishes all its iterations (until cancel condition is reached) and goes back to the outer loop which now would start its second iteration.

But what tool we use, instead of nested for loops, when we want a loop with lets say five iterations iterate only one and then want a following for loop also iterate only one-time, before it goes back to the first loop for its second iteration, after from there to second loop for its second iteration and so on...?

Also, can someone point me out what is happening in this code:

Code:
#include <stdio.h>

int main() {
    int i, j, n;
    scanf("%d", &n);


    for (i = 0; i <= (n/2); i++) {
        printf("%*s", i, "");
        printf("*");
        for(j = n-2; j >= 0; j = j - 2) {
            printf("%*s", j, "");
            printf("*\n");
        }
    }


     return 0;
}

Regards,
Placebo