2,042 views
1 votes
1 votes
How many times the " PROCESS " will be printed  when executing the following program?
main() {
printf(" PROCESS");
fflush();
fork();
fork();
}
a) 8                        b)4                            c)6                                  d)7

1 Answer

1 votes
1 votes

Answer 4 :

fflush() will be necessary to hold the output of the process together or print it when it's necessary(Usually when buff is full). Now each fork() will produce 2 child process. So total no of process will be 22=4. So a total of 4 times "PROCESS" will be printed.

edited by

Related questions

1.5k
views
1 answers
1 votes
habedo007 asked Aug 30, 2018
1,533 views
The function $f(x)=\frac{x^2 -1}{x-1}$ at $x=1$ is:Continuous and Differentiable Continuous but not DifferentiableDifferentiable but not ContinuousNeither Continuous nor Differentiable
1.5k
views
1 answers
1 votes
mohitbawankar asked Dec 24, 2017
1,454 views
What is Compaction?a) a technique for overcoming internal fragmentationb)a paging techniquec)a technique for overcoming external fragmentationd)a technique for overcoming fetal error
59
views
0 answers
0 votes
admin asked Sep 30, 2023
59 views
Ram and shyam are two different persons, but when they worked together, they completed a job in $10$ days. Had Ram worked at half of his efficiency and shyam at five times of ... . Then $\mathrm{y}$ is :$20$ days$30$ days$40$ days$35$ days