+ 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

7th Jun 2019, 11:21 AM
김도현
김도현 - avatar
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
9th Jun 2019, 4:39 AM
LetterC67
LetterC67 - avatar