Skip to content

Commit

Permalink
Resolved Issue smuos#2 - Added mean function to mm.c
Browse files Browse the repository at this point in the history
  • Loading branch information
rikkustrife committed Sep 28, 2014
1 parent e4c954d commit dd1dcd5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ int numcmp (const void *a, const void *b) {
return 0;
}

//function to calculate the mean
int mean (int *p, int length)
{
int i, total;
for (i = 0, i < length(), i++)
{
total = total + p[i];
}
return total/length;
}

int main(int argc, char *argv[]) {

int i, length, *pt;
Expand Down

0 comments on commit dd1dcd5

Please sign in to comment.