Recent questions tagged fork-system-call

2 votes
0 answers
91
for(i=1;i<=3;i++) { fork(); printf("x"); }How many times 'x' is printed ?
12 votes
3 answers
94
Consider the following code snippet:if(fork()&& fork()) { fork(); } if(fork()||fork()) { fork(); fork(); } printf("GATE 2017");How many times GATE 2017 printed ?
6 votes
4 answers
96
#include <stdio.h #include <unistd.h int main() { int i; for(i=1;i<=3;i++) { fork(); printf("*"); } return 0; }how many times * will be printed ?...is it 11?
2 votes
1 answer
97
#include<stdio.h #include<unistd.h int main() { for(i=0;i<2;i++) { if(fork()==0) printf("hello"); } }
7 votes
2 answers
99
Consider the following program.main() { fork(); fork(); fork(); }How many new processes will be created?8675
3 votes
3 answers
100
Fork isthe creation of a new jobthe dispatching of a taskincreasing the priority of a taskthe creation of a new process
1 votes
2 answers
102
How many times Hi printed and how many child process will created?include<stdio.h int main() { printf("hi"); fork(); fork(); }
4 votes
4 answers
103
3 votes
3 answers
104
What is the output and how many child(what is the code of all other child .what they copied from parent give tree diagram)t1=0;t2=0;Fork();Printf("hi");t1=Fork();Printf("...
7 votes
3 answers
105
1 votes
2 answers
106
for (int i = 0; i<4; i++) { fork(); }What is no of child nodes at each level ?
41 votes
6 answers
109
A process executes the following segment of code :for(i = 1; i <= n; i++) fork ();The number of new processes created is$n$$((n(n + 1))/2)$$2^n - 1$$3^n - 1$
11 votes
8 answers
110
Consider the following Pseudo codemain() { int t1=0,t2=0,t3=0; t1=fork(); t2=fork(); if(t1!=0) { t3=fork(); printf("0"); } }Find the total number of processes that will b...
29 votes
3 answers
112
A process executes the following codefor(i=0; i<n; i++) fork();The total number of child processes created is$n$$2^n-1$$2^n$$2^{n+1} - 1$
34 votes
4 answers
113
A process executes the codefork(); fork(); fork();The total number of child processes created is$3$$4$$7$$8$