Submitted by Muzammil Muneer on Monday, September 22, 2014 - 22:54.

#include<stdio.h> #include<conio.h>

double getAverage(int *arr, int size); int main() { int list[5]; int size=5; int i; for( i=0;i<size;i++) { } double avg; avg = getAverage( list, size ) ; return 0; }

double getAverage(int *arr, int size) { int i, sum = 0; double avg; for (i = 0; i < size; ++i) { sum =sum+ arr[i]; } avg = (double)sum / size; return avg; }

- 55 views