Question: develop c programing language and here I attached program and give me screenshort of output for this program Develop a program that accepts integers from
develop c programing language and here I attached program and give me screenshort of output for this program
-
Develop a program that accepts integers from command line and uses fork() to have 4 child processes that will do sorting the quick sort, computing the sum of the integers, and counting the number of even numbers and the number of odd numbers respectively.
/*Template for program */
/*After conversion of string integers to real integers, do the follows so that there are 4 child processes. */ #include switch(fork()) { case -1: break; case 0: /*1st child process*/ /*here for sorting*/ exit(1); default: switch(fork()) { case -1: break; case 0: /*2nd child process*/ /*here for summing*/ exit(2); default: switch(fork()) { case -1: break; case 0: /*3rd child process*/ /*here for counting even*/ exit(3); default: switch(fork()) { case -1: break; case 0: /*4th child process*/ /*here for counting odd*/ exit(4); default: break: } } } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
