I would store the results in vector(s). That keeps calculation separate from output.
When all the max are in one vector and min in other, it is easy to output all max as one line and the all the min as second line. Thus, the max and min of column k will form the column k of the output.
One has to remember that an input column may have no values at all. You cannot calculate anything for nothing and therefore your program has to cover that special case too.
I have posted on this thread code that calculates min, max and mean for a vector. However, they are such beginner operations that one should have mastered those well before one did embark on this task that involves input of multiple vectors.