Please, if the question asked before don’t write the same answer, solution should be unique
Write a “C” language program, that first asks the user the number of real values to read; then it reads the values into a dynamically allocated array. At the end the program should print the elements of the array backwards, and release the allocated memory!
Hint
To store arbitrary many values – not limited by neither the size of a static array nor the size of the stack –, dynamic memory handling is needed. Remember the lecture: malloc() allocates dynamic memory returning the starting address of the block. It can be casted to any type, depending on the type of elements we would like to store in the array. When we do not need the array anymore calling the free() function will release the allocated dynamic memory. Allocating the array must obviously be preceeded by reading the number of values.