Question: 5. Given the following program, please determine how many times the word hello is printed out. Assume that fork() is always successful. (5 points)
5. Given the following program, please determine how many times the word "hello" is printed out. Assume that fork() is always successful. (5 points) #include #include int main() { pid_t a, b; a = fork(); b = fork(); if (a == 0) b = fork (); if (b == 0) a = fork (); printf("hello "); return 0;
Step by Step Solution
3.39 Rating (155 Votes )
There are 3 Steps involved in it
The provided image contains C code that uses multiple fork system calls to create child processes Th... View full answer
Get step-by-step solutions from verified subject matter experts
