+ 1
sumaverage pointer
https://code.sololearn.com/cKD7sh3rdJ6G/#c In this code, the average doesn't comes out right. It comes 0 and I want to get &ave=*average in the function and returns to main function, print out ave. Can you help me with the code
1 Resposta
+ 2
Change this line: int get_sum_average(int arr[5],int size, int *average)
to > int get_sum_average(int arr[5],int size, double *average)
because ave variable is double