So I working on a program that in a poin in the program I have to get the median and the average of the numbers in the array.

I have to write a program that will read in a list of positive integers (including zero) and display some statistics regarding the integers.


first put the list of your numbers in an array.
1. median: get array.size()

if (odd) median=array[size/2-1]   //if size=3 return array[1]
if even median=(array[size/2]+array[size/2-1])/2


int mean;
int sum=0;
for(int i=0; i<array.size(),i++){