Allocate and summarize a runtime-sized array

Read n in 0..100 followed by n integer tokens, all representable as int and required to be in -1000..1000. Allocate exactly n ints when n > 0, then report n, sum, minimum and maximum; print empty for n = 0. Check the multiplication size, allocation and each conversion. On bad element input print input error, release memory and fail. Explain why long can hold this sum even on a conforming implementation with a 16-bit int, and why no minimum exists for empty input.


