Skip to content

Commit

Permalink
Fixes smuos#2 Add a function, mean()
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiying Zhang committed Sep 30, 2014
1 parent bb9e7b2 commit 6cfd8cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ int numcmp (const void *a, const void *b) {
double mean (int *num, int len){
double sum = 0, mean = 0;
//using a for loop to add up all the values in input numbers
for(int i = 0; i<len ;i++){
int i;
for( i = 0; i<len ;i++){
sum = sum + num[i];
}
//Find the mean
Expand Down

0 comments on commit 6cfd8cb

Please sign in to comment.