Need a Solution for this.

Question is

Write a code segment to input and finding the sum and average of n numbers.