Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions tagged fork-system-call
0
votes
2
answers
31
Operating System
On Solving manually I too getting 14 as answer. but on running more than 14 * are printed.
Overflow04
asked
in
Operating System
Aug 29, 2022
by
Overflow04
860
views
operating-system
ace-test-series
fork-system-call
0
votes
1
answer
32
justify the answer
how many child process will be created for the following code.how many hello and welcome will be printed #include <stdio.h> void main() { fork(); fork(); printf("Hello \n"); fork(); printf("welcome\n"); }
emlin
asked
in
Operating System
Jun 26, 2022
by
emlin
3.6k
views
fork-system-call
1
vote
2
answers
33
Geeksforgeeks mock - 2022
Consider the following C program: #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main (void) { pid_t pid; int x = 2; pid = fork ( ); if (pid = = 0); x = 8; fork( ); printf("%d", x); return 0; } Fork ( ) is a system call creates new ... the program is executed on the unix OS?[MSQ] (a) 8 2 2 8 (b) 8 8 2 2 (c) 2 8 8 2 (d) 2 2 8 8
o
asked
in
Operating System
Dec 19, 2021
by
o
1.4k
views
operating-system
multiple-selects
fork-system-call
5
votes
8
answers
34
Andrew S. Tanenbaum (OS) Edition 4 Exercise 2 Question 39 (Page No. 177)
Consider the following piece of C code: void main( ) { fork( ); fork( ); exit( ); } How many child processes are created upon execution of this program?
admin
asked
in
Operating System
Oct 25, 2019
by
admin
3.4k
views
tanenbaum
operating-system
process-and-threads
fork-system-call
descriptive
13
votes
4
answers
35
fork() using Tree structure
How many times ‘4’ will be printed ? int main() { if (fork() && (!fork())) { if (fork() || fork()) { fork(); } } printf("4 "); return 0; } How to approach these kind of questions using Tree structure ??
Brij gopal Dixit
asked
in
Operating System
Jun 13, 2019
by
Brij gopal Dixit
8.8k
views
fork-system-call
2
votes
2
answers
36
Virtual Gate Test Series: Operating System - Fork-Join Concurrency Structure
Consider the code fragment: count = 3; S1; Fork L1; L1: S3; S2; goto L3; S4; Fork L2; L2: S6; goto L3; S5; L3: join count S7 Which one of the following represents correct precedence graph of the above code fragment? the answer is given but I’m getting where am I wrong?
aditi19
asked
in
Operating System
Jun 12, 2019
by
aditi19
3.9k
views
operating-system
precedence-graph
fork-system-call
concurrency
virtual-gate-test-series
1
vote
1
answer
37
Galvin Edition 9 Exercise 3 Question 1 (Page No. 149)
#include <sys/types.h> #include <stdio.h> #include <unistd.h> int value = 5; int main() { pid t pid; pid = fork(); if (pid == 0) { /* child process */ value += 15; return 0; } else if (pid > 0) { /* ... ;PARENT: value = %d",value); /* LINE A */ return 0; } } Explain what the output will be at LINE A in this program.
akash.dinkar12
asked
in
Operating System
Mar 19, 2019
by
akash.dinkar12
937
views
galvin
operating-system
process
programming
fork-system-call
9
votes
4
answers
38
Fork (ACE)
main() { if(fork()>=0) { printf("*"); if(fork()==0) { printf("*"); } else{ //do nothing } printf("*"); } How many number of times “*” will be printed?
srestha
asked
in
Operating System
Feb 27, 2019
by
srestha
3.3k
views
fork-system-call
operating-system
24
votes
8
answers
39
GATE CSE 2019 | Question: 17
The following C program is executed on a Unix/Linux system : #include<unistd.h> int main() { int i; for(i=0; i<10; i++) if(i%2 == 0) fork(); return 0; } The total number of child processes created is ________________ .
Arjun
asked
in
Operating System
Feb 7, 2019
by
Arjun
17.2k
views
gatecse-2019
numerical-answers
operating-system
fork-system-call
1-mark
3
votes
1
answer
40
Ace Test Series: Operating System - Fork()
Na462
asked
in
Operating System
Feb 2, 2019
by
Na462
2.2k
views
operating-system
fork-system-call
ace-test-series
1
vote
2
answers
41
Applied Course | Mock GATE | Test 1 | Question: 48
Assume the following program is compiled and run on a modern Linux machine: main() { int x = 0; int a = fork(); x++; if (a == 0) { a = fork(); x++; } else { x++; } printf("GATE!\n"); printf("x is %d ... $"x"$ may have different values on different runs of the program. $2$ $3$ $5$
Applied Course
asked
in
Operating System
Jan 16, 2019
by
Applied Course
863
views
applied-course-2019-mock1
numerical-answers
operating-system
fork-system-call
1
vote
1
answer
42
fork and exec
what is the output of the following program? int ret = fork(); if(ret == 0) { exec(some_binary); // this call fails printf("child "); }else { wait(); printf("parent\n"); } Runtime Error child parent child parent
dd
asked
in
Operating System
Jan 13, 2019
by
dd
822
views
fork-system-call
operating-system
0
votes
1
answer
43
UPPCL AE 2018:36
Consider the following program. #include<stdio.h> #include<stdlib.h> #include<unistd.h> int main(void) { pid_t pid; int varl = 100; pid = fork(); if(pid == 0) /* Child process */ varl = 200; fork(); printf( %d , varl); return 0; } Assuming all invocations of fork are ... $200 \; 200 \; 200 \; 200$ $100 \; 100 \; 100 \; 100$ $100 \; 200 \; 200 \; 200$
admin
asked
in
Operating System
Jan 5, 2019
by
admin
381
views
uppcl2018
operating-system
system-call
fork-system-call
1
vote
2
answers
44
OS FORK---OUTPUT
int main(void) { int var1=100; int pid; if(pid==fork()) var1=200; fork(); printf("%d",var1); return 0; } what could be the output ? a)100 100 200 200 b)200 200 200 200 c)none
junaid ahmad
asked
in
Operating System
Jan 1, 2019
by
junaid ahmad
1.5k
views
operating-system
fork-system-call
7
votes
2
answers
45
GATE Overflow | Mock GATE | Test 1 | Question: 12
Consider a parent process $P$ that has forked a child process $C$. $C$ has again forked another child process $D$. Now $P$ terminates while $C$ and $D$ are still running. In this case, which of the following statements ... process, until adopted by the parent process of $P$ $P$ immediately becomes an orphan process, until adopted by its parent
Ruturaj Mohanty
asked
in
Operating System
Dec 27, 2018
by
Ruturaj Mohanty
3.4k
views
go-mockgate-1
operating-system
process-and-threads
fork-system-call
0
votes
0
answers
46
self doubt fork
ans is 20. pls explain procedure. thanx in advance
Shubham Aggarwal
asked
in
Operating System
Dec 7, 2018
by
Shubham Aggarwal
406
views
fork-system-call
0
votes
2
answers
47
Operating System: Fork
A process executes the following segment of code: int main() { fork(); fork() && fork(); } The number of new processes created is __________ Can someone pls explain me the solution
Pavan Shetty
asked
in
Operating System
Nov 24, 2018
by
Pavan Shetty
1.8k
views
operating-system
fork-system-call
1
vote
2
answers
48
Self doubt -OS-FORK()
Warrior
asked
in
Operating System
Nov 10, 2018
by
Warrior
1.3k
views
operating-system
fork-system-call
3
votes
2
answers
49
#OS Fork () tell the O/P?
A process executes the following segment of code : for(i = 1; i <= n; i++) fork (); fork (); The number of new processes created is
iarnav
asked
in
Operating System
Oct 18, 2018
by
iarnav
1.9k
views
fork-system-call
operating-system
1
vote
1
answer
50
#OS Fork () tell the output?
void forkexample() { // child process because return value zero if (fork() == 0) printf("Hello from Child!\n"); // parent process because return value non-zero. else printf("Hello from Parent!\n"); } int main() { forkexample(); return 0; } Please someone explain how things are working?
iarnav
asked
in
Operating System
Oct 17, 2018
by
iarnav
808
views
operating-system
fork-system-call
1
vote
2
answers
51
made esay systeam call
amit166
asked
in
Operating System
Oct 12, 2018
by
amit166
598
views
fork-system-call
0
votes
0
answers
52
Self Doubt on Fork with logical OR
if (e1 || e2 ) { print "OK" } print "HAI" if e1 is true, with out checking e2 ===> it directly prints OK then HAI let take, it is fork in the place of e1 ===> 1) parent ( which have > 0 ) ===> e1 is true, ===> OK HAI printed 2) child ( which have = 0 ) ==> e1 false, ==> check e2. is it right or wrong?
Shaik Masthan
asked
in
Programming in C
Sep 16, 2018
by
Shaik Masthan
1.1k
views
fork-system-call
logical-or
0
votes
2
answers
53
Fork system call,open file table
The fork system call creates new entries in the open file table for the newly created child process. [True / False] [ what is open file table ? ]
dd
asked
in
Operating System
Sep 15, 2018
by
dd
1.0k
views
operating-system
fork-system-call
4
votes
1
answer
54
RBRTestSeries
The value of z after the execution of the following program is void f(int x) { static int z; z=z+x; } int main() { int y=10; fork(); fork(); f(y); return 0; } Options are: a. 40 b. 30 c. 20 d. 10
sumedha bhatia
asked
in
Operating System
Sep 5, 2018
by
sumedha bhatia
1.5k
views
fork-system-call
operating-system
test-series
9
votes
2
answers
55
Fork System Call
A process execute the code: main() { fork(); fork() && fork() || fork(); fork(); printf("Hi"); } The number of times "Hi" will be printed is
nandini gupta
asked
in
Operating System
Aug 12, 2018
by
nandini gupta
4.7k
views
operating-system
fork-system-call
Page:
« prev
1
2
3
4
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent questions tagged fork-system-call
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...