Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged fork-system-call
2
votes
0
answers
91
fork() system call
for(i=1;i<=3;i++) { fork(); printf("x"); } How many times 'x' is printed ?
for(i=1;i<=3;i++) { fork(); printf("x"); }How many times 'x' is printed ?
dd
1.1k
views
dd
asked
Oct 24, 2016
Operating System
operating-system
fork-system-call
+
–
3
votes
3
answers
92
Operating system Made Easy Test series problem: fork Problem
I always face problem in fork questions please explain in detail (with theory). Thanks
I always face problem in fork questions please explain in detail (with theory). Thanks
Devwritt
3.5k
views
Devwritt
asked
Oct 23, 2016
Operating System
operating-system
fork-system-call
made-easy-test-series
test-series
+
–
6
votes
1
answer
93
fork()
Consider the code below and choose the correct option: main(){ int child = fork(); int c = 5; if(child == 0) c += 5; else{ child = fork(); c += 10; if(child) c += 5; } } (A) Total 3 processes are there with value of variable c as 5, 10, and 15. ( ... processes are there with value of variable c as 10, 15, and 15. (D) Total 4 processes are there with value of variable c as 10, 15, 15, and 20.
Consider the code below and choose the correct option:main(){ int child = fork(); int c = 5; if(child == 0) c += 5; else{ child = fork(); c += 10; if(child) c += 5; } }(A...
srestha
2.2k
views
srestha
asked
Sep 30, 2016
Operating System
fork-system-call
+
–
12
votes
3
answers
94
fork system call
Consider the following code snippet: if(fork()&& fork()) { fork(); } if(fork()||fork()) { fork(); fork(); } printf("GATE 2017"); How many times GATE 2017 printed ?
Consider the following code snippet:if(fork()&& fork()) { fork(); } if(fork()||fork()) { fork(); fork(); } printf("GATE 2017");How many times GATE 2017 printed ?
Akriti sood
10.8k
views
Akriti sood
asked
Sep 26, 2016
Operating System
fork-system-call
operating-system
+
–
2
votes
3
answers
95
General Topic Doubt Operating System: Fork
How is the answer coming out to be 32?
How is the answer coming out to be 32?
Ishita Gupta
985
views
Ishita Gupta
asked
Sep 10, 2016
Operating System
fork-system-call
system-call
operating-system
general-topic-doubt
+
–
6
votes
4
answers
96
fork
#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?
#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?
qwertyui
5.6k
views
qwertyui
asked
Sep 1, 2016
Operating System
fork-system-call
+
–
2
votes
1
answer
97
fork
#include<stdio.h> #include<unistd.h> int main() { for(i=0;i<2;i++) { if(fork()==0) printf("hello"); } }
#include<stdio.h #include<unistd.h int main() { for(i=0;i<2;i++) { if(fork()==0) printf("hello"); } }
qwertyui
4.4k
views
qwertyui
asked
Aug 20, 2016
Operating System
fork-system-call
+
–
2
votes
1
answer
98
Fork system call
By using fork system call, we create an exact copy of the current process and copies all its code, data to a new process. While data will be changed along with the execution of the program, code will remain same. So is it possible that operating system keep a single code data and map to parent as well as child process unlike to copy code also?
By using fork system call, we create an exact copy of the current process and copies all its code, data to a new process.While data will be changed along with the executi...
Mandeep Singh
853
views
Mandeep Singh
asked
Aug 1, 2016
Operating System
operating-system
fork-system-call
+
–
7
votes
2
answers
99
ISRO2015-37
Consider the following program. main() { fork(); fork(); fork(); } How many new processes will be created? 8 6 7 5
Consider the following program.main() { fork(); fork(); fork(); }How many new processes will be created?8675
go_editor
3.9k
views
go_editor
asked
Jun 19, 2016
Operating System
isro2015
operating-system
fork-system-call
+
–
3
votes
3
answers
100
ISRO2008-63
Fork is the creation of a new job the dispatching of a task increasing the priority of a task the creation of a new process
Fork isthe creation of a new jobthe dispatching of a taskincreasing the priority of a taskthe creation of a new process
go_editor
2.2k
views
go_editor
asked
Jun 12, 2016
Operating System
isro2008
operating-system
fork-system-call
+
–
2
votes
2
answers
101
Fork query what will be the effect of t3= -1 here?
khushtak
717
views
khushtak
asked
Jan 10, 2016
Operating System
fork-system-call
operating-system
+
–
1
votes
2
answers
102
Fork
How many times Hi printed and how many child process will created? include<stdio.h> int main() { printf("hi"); fork(); fork(); }
How many times Hi printed and how many child process will created?include<stdio.h int main() { printf("hi"); fork(); fork(); }
sourabh
2.5k
views
sourabh
asked
Dec 25, 2015
Operating System
operating-system
fork-system-call
+
–
4
votes
4
answers
103
Fork
what if the program like this(t1 is copied to all or printf will copied to all child) main() { t1=0,t2=0; t2=fork(); Fork(); Printf("Hi"); Fork(); t1=Fork(); Printf("hi"); } Arjun sir , I don't know the buffer concept.please explain with tree method. How many child and how many time Hi printed.
what if the program like this(t1 is copied to all or printf will copied to all child)main(){t1=0,t2=0;t2=fork();Fork();Printf("Hi");Fork();t1=Fork();Printf("hi");}Arjun s...
sourabh
1.3k
views
sourabh
asked
Dec 6, 2015
Operating System
fork-system-call
+
–
3
votes
3
answers
104
Fork
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("hi"); t2=fork(); printf("hi); fork(); printf("hi);
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("...
sourabh
908
views
sourabh
asked
Dec 5, 2015
Operating System
fork-system-call
+
–
7
votes
3
answers
105
fork() system call
How many processes will be spawned after executing this program? #include <stdio.h> #include <unistd.h> int main() { fork(); fork() && fork() || fork(); fork(); printf("forked\n"); return 0; } How to tackle the order of logical operations?
How many processes will be spawned after executing this program?#include <stdio.h>#include <unistd.h>int main(){ fork(); fork() && fork() || fork(); fork(); print...
Rohit Mallik
9.0k
views
Rohit Mallik
asked
Nov 24, 2015
Operating System
operating-system
fork-system-call
+
–
1
votes
2
answers
106
System call
for (int i = 0; i<4; i++) { fork(); } What is no of child nodes at each level ?
for (int i = 0; i<4; i++) { fork(); }What is no of child nodes at each level ?
priti sharma
768
views
priti sharma
asked
Oct 17, 2015
Operating System
operating-system
fork-system-call
+
–
1
votes
2
answers
107
How many process are created by the program?
int main(){ int i; for(i=0;i<4;i++) fork(); return 0; } in my calculation i think 14 processes will be created including the the parent process. am i right ? Is there any easier method to solve this kind of question ?? please provide the right approach to solve these kind of problems
int main(){ int i; for(i=0;i<4;i++) fork(); return 0; }in my calculation i think 14 processes will be created including the the parent process. am i right ? Is there any ...
admin
4.6k
views
admin
asked
Oct 11, 2015
Operating System
operating-system
fork-system-call
+
–
1
votes
2
answers
108
Mysterious Fork() call?
Vikrant Singh
1.3k
views
Vikrant Singh
asked
Jan 25, 2015
Operating System
fork-system-call
operating-system
+
–
41
votes
6
answers
109
GATE IT 2004 | Question: 64
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$
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$
Ishrat Jahan
12.0k
views
Ishrat Jahan
asked
Nov 2, 2014
Operating System
gateit-2004
operating-system
fork-system-call
easy
+
–
11
votes
8
answers
110
how many process created?
Consider the following Pseudo code main() { 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 be created by the above program execution.
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...
neha pawar
9.2k
views
neha pawar
asked
Oct 30, 2014
Operating System
operating-system
fork-system-call
+
–
123
votes
9
answers
111
GATE CSE 2005 | Question: 72
Consider the following code fragment: if (fork() == 0) { a = a + 5; printf("%d, %p n", a, &a); } else { a = a - 5; printf ("%d, %p n", a,& a); } Let $u,v$ be the values printed by the parent process and $x,y$ be the values printed by the child ... $u + 10 = x \text{ and } v = y$ $u + 10 = x \text{ and } v != y$
Consider the following code fragment: if (fork() == 0) { a = a + 5; printf("%d, %p n", a, &a); } else { a = a - 5; printf ("%d, %p n", a,& a); }Let $u,v$ be the values pr...
Nishant T-rex
37.3k
views
Nishant T-rex
asked
Sep 14, 2014
Operating System
gatecse-2005
operating-system
fork-system-call
normal
+
–
29
votes
3
answers
112
GATE CSE 2008 | Question: 66
A process executes the following code for(i=0; i<n; i++) fork(); The total number of child processes created is $n$ $2^n-1$ $2^n$ $2^{n+1} - 1$
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$
Kathleen
17.1k
views
Kathleen
asked
Sep 12, 2014
Operating System
gatecse-2008
operating-system
fork-system-call
normal
+
–
34
votes
4
answers
113
GATE CSE 2012 | Question: 8
A process executes the code fork(); fork(); fork(); The total number of child processes created is $3$ $4$ $7$ $8$
A process executes the codefork(); fork(); fork();The total number of child processes created is$3$$4$$7$$8$
gatecse
12.9k
views
gatecse
asked
Aug 5, 2014
Operating System
gatecse-2012
operating-system
easy
fork-system-call
+
–
Page:
« prev
1
2
3
4
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register