Dynamic memory allocation for the output array

why we need a dynamic memory allocation for the output array