given a number, from 0 to number - 1, assign number to array indexes in reverse order

for example,

int n = 5
int* array;
array = (int*)malloc(n * sizeof(int));

how do we get this array without using a nested for loop: {4, 3, 2, 1, 0}

I tried:

for (int i = n - 1; i <= 0; i++) {
    array[n - i - 1] = i;
}