Skip to content

Commit

Permalink
Removed unused wc int.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeada committed Oct 2, 2014
1 parent 21b62f6 commit c646a94
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,13 @@ int main(int argc, char *argv[]) {
exit(-1);
} else if (rc == 0) { // child runs median:
int med = median(pt, length);
fprintf(stdout, "%d ", med);
fprintf(stdout, "Median = %d ", med);
} else if (rc > 0) { // parent runs mean:
int wc = wait(NULL); // waits until child has finished
wait(NULL); // waits until child has finished
int avg = mean(pt, length);
fprintf(stdout, "%d ", avg);
fprintf(stdout, "Mean = %d ", avg);
}

// Print out numbers
fprintf(stdout, "%s: Sorted output is: \n", argv[0]);
for (i=0; i<length; i++) {
fprintf(stdout, "%d ", pt[i]);
}
fprintf(stdout, "\n%s: FIN. \n", argv[0]);

return 0;
Expand Down

0 comments on commit c646a94

Please sign in to comment.