The main idea here is to use recursion instead of a loop to read and write characters. Indeed, in order to derive N numbers in the reverse order of reading, you must first output N-1 the last number in reverse order, and then the first one. Continuing the analogy, we reach N = 1, in this case we simply output a number.
In pseudocode, the idea looks like this:
функция вывести_N_чисел_в_обратном_порядке(N) x = прочитать_число() если N > 1 вывести_N_чисел_в_обратном_порядке(N - 1) вывести_число(x)
The main trick here is storing the read numbers on the call stack, which allows, first, to do without explicitly declaring the array, and second, to pull the numbers in the reverse order of the record.
fseek()
cannot be used - into the firebox, as a question with artificial restrictions, the answer to which will not give anything to anyone. - PashaPash ♦