Skip to content

Commit

Permalink
Parent and Child now print their results. Fixes smuos#5 and Fixes smu…
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeada committed Oct 2, 2014
1 parent becb0cf commit 41f0bca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ int main(int argc, char *argv[]) {
fprintf(stdout, "Fork failed.\n");
exit(-1);
} else if (rc == 0) { // child runs median:
median(pt, length);
int med = median(pt, length);
fprintf(stdout, "%d ", med);
} else if (rc > 0) { // parent runs mean:
mean(pt, length);
int avg = mean(pt, length);
fprintf(stdout, "%d ", avg);
}

// Print out numbers
Expand Down

0 comments on commit 41f0bca

Please sign in to comment.