int getAvarage(int arr[],int length); int main(){ int arr[6]={34,10,56,29,17,23}; int average=getAvarage(arr,6); printf("%d\n",average); return 0; }
int getAvarage(int arr[],int length){ int total=0; for (int i=0; i<length; i++) { total+=arr; } return total/length; }
|