Write a program, that reads a cardinal N — an array size, then N integers. Reorder the array in such a way that the elements of it's first half take corresponded even positions, and the elements of it's second half reordered backwards and take odd positions. If N is odd, first half is bigger than second.
11 23 89 34 35 79 26 78 72 37 86 82
Use malloc() to allocate memory for the array.
23 82 89 86 34 37 35 72 79 78 26
To be precise:
1 2 3 4 5 6 7 8 9 10 11 → 1 11 2 10 3 9 4 8 5 7 6
1 2 3 4 5 6 7 8 9 10 ⇒ 1 10 2 9 3 8 4 7 5 6
You can use another array to store the result,
…but here's a challenge not to use any other arrays!