Skip to content

Commit

Permalink
Fixed smuos#2
Browse files Browse the repository at this point in the history
  • Loading branch information
OneDamien committed Sep 25, 2014
1 parent fb089b4 commit 3f99162
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ int numcmp (const void *a, const void *b) {
return 0;
}

double mean(int num[], int length){
int x;
for(int i = 0; i < length; i++){
x=+num[i];
}
return x/length;
}

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

int i, length, *pt;
Expand Down Expand Up @@ -46,6 +54,7 @@ int main(int argc, char *argv[]) {
for (i=0; i<length; i++) {
fprintf(stdout, "%d ", pt[i]);
}
fprintf(stdout, "\n%f: is the mean.\n", mean(pt, length));
fprintf(stdout, "\n%s: FIN. \n", argv[0]);

return 0;
Expand Down

0 comments on commit 3f99162

Please sign in to comment.