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
7
votes
1
answer
61
fork() system call.
for ( i = 1; i<=3; i++ ) { fork(); fork(); } How many child process will create ?
saurav raghaw
asked
in
Operating System
Aug 8, 2018
by
saurav raghaw
3.1k
views
operating-system
fork-system-call
0
votes
0
answers
62
General Topic Doubt Operating Systems: Fork
what is output?
arun_singh
asked
in
Operating System
Aug 4, 2018
by
arun_singh
619
views
operating-system
fork-system-call
general-topic-doubt
1
vote
1
answer
63
GATE Suitability Test | Test 1 | Question: 2
The set of values printed (in any order) by the following code will be #include<stdio.h> #include<unistd.h> int main() { static int count; if(fork()) { count++; } if(fork() && !count++) count++; printf(“%d \t”, count); } 0 1 1 2 0 0 1 2 0 1 2 2 2 2 2 2
Arjun
asked
in
Operating System
Jun 10, 2018
by
Arjun
314
views
gate-suitability-test-1
fork-system-call
1
vote
2
answers
64
Doubt about fork()
#include <stdio.h> int main(void) { int i=0; printf("HAI\n"); for(i=1;i<=3;i++) { if(fork()==0) printf("*"); } return 0; } How many times * will be printed? and How many times HAI will be printed?
Shaik Masthan
asked
in
Operating System
Jun 4, 2018
by
Shaik Masthan
891
views
operating-system
fork-system-call
5
votes
1
answer
65
Fork Output
#include<stdio.h> #include<sys/types.h> #include<unistd.h> void forkexample() { int x = 1; if (fork() == 0) printf("Child has x = %d\n", ++x); else printf("Parent has x = %d\n", --x); } int main() { forkexample(); return 0; ... = 2 (or) Child has x = 2 Parent has x = 0 I guess both because we dont know who will return first parent or child is it ?
Na462
asked
in
Operating System
May 25, 2018
by
Na462
4.0k
views
operating-system
fork-system-call
0
votes
1
answer
66
Fork Process
#include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(void) { pid_t pid = fork(); pid = fork(); pid = fork(); if (pid == 0) { fork(); } fork(); return 0; } Total Number of Processes existing will be ... Processes (12 Parent and $12$ child). Please see my solution carefully and point out weather the number of parent and child were calculated correctly ?
Na462
asked
in
Operating System
May 25, 2018
by
Na462
899
views
operating-system
fork-system-call
2
votes
2
answers
67
C Programming
main() { if(fork()>0) sleep(100); } The given code results in the creation of: I) an orphan process II) a zombie process III) a process that executes forever IV) None of these Can someone explain this?
gauravkc
asked
in
Programming in C
Apr 30, 2018
by
gauravkc
9.8k
views
programming-in-c
programming
output
fork-system-call
3
votes
3
answers
68
ISRO2018-4
The following $C$ program: { fork(); fork(); printf("yes"); } If we execute this core segment, how many times the string yes will be printed? Only once 2 times 4 times 8 times
Arjun
asked
in
Operating System
Apr 22, 2018
by
Arjun
10.8k
views
isro2018
fork-system-call
operating-system
1
vote
3
answers
69
PGEE 2018
void main(){ fork(); fork(); printf("Hello"); } How many time print function will execute
Tesla!
asked
in
Operating System
Apr 22, 2018
by
Tesla!
833
views
iiith-pgee
operating-system
fork-system-call
2
votes
1
answer
70
Fork System Call
#include<stdio.h> #include<stdlib.h> void main() { int a =100; if(fork()==0) { a=a+5; printf("%d %d \n",a,&a ); } } How many parent and child process will be created?
srestha
asked
in
Operating System
Mar 8, 2018
by
srestha
2.5k
views
operating-system
fork-system-call
0
votes
2
answers
71
mock test
Consider following pseudo code : main() { int t1,t2,t3; t1=t2=t3=0; t1=fork(); t2=fork(); if (t1!=0){ t3=fork(); printf("Hello"); } } How many Hello's are printed when above code get executed. $1$ $2$ $3$ $4$
bhanu kumar 1
asked
in
Operating System
Feb 27, 2018
by
bhanu kumar 1
1.2k
views
fork-system-call
operating-system
0
votes
1
answer
72
fork() call in operating systems
Kindly explain Output of the given program....
khalida mujahid
asked
in
Operating System
Feb 8, 2018
by
khalida mujahid
886
views
operating-system
fork-system-call
linux
1
vote
2
answers
73
Ace Test series: Operating System - Fork
What is the number of child process created ? Answer given was 63, BUT i am getting 9 !
♥_Less
asked
in
Operating System
Jan 12, 2018
by
♥_Less
1.8k
views
operating-system
fork-system-call
ace-test-series
programming
programming-in-c
2
votes
4
answers
74
fork()
1)Consider the following pseudo code: for(i=1;i<=4;i++) { fork(); printf("X"); } How many times “X” is printed? 2) Consider the following pseudo code: void main() { fork(); fork(); fork(); fork(); printf("X"); } How many times “X” is printed?
ankitgupta.1729
asked
in
Operating System
Dec 14, 2017
by
ankitgupta.1729
1.4k
views
fork-system-call
operating-system
0
votes
1
answer
75
MadeEasy Subject Test 2017: Operating System - Fork
how to make concurrency diagram plz explain?
nikkey123
asked
in
Operating System
Nov 19, 2017
by
nikkey123
674
views
made-easy-test-series
made-easy-test-series-2017
operating-system
fork-system-call
7
votes
4
answers
76
Self Doubt
{ if(fork()&& fork()) { fork(); } if(fork()||fork()) { } printf("GATE\n"); How many times GATE will be printed? and also the explanation
Mk Utkarsh
asked
in
Operating System
Nov 14, 2017
by
Mk Utkarsh
1.2k
views
operating-system
fork-system-call
4
votes
3
answers
77
made easy practice book
What is the output of the following program? main(){ printf("Hi"); fork(); } a) HiHi b) Hi c) nothing will be printed d) none of the above
charul
asked
in
Operating System
Nov 10, 2017
by
charul
785
views
operating-system
fork-system-call
11
votes
3
answers
78
self doubt OS fork()
find total no of processes i am getting 29 as answer as all will be child process except one parent process plz explain how answer is 24 here i am very confused in such question by drawing diagram #include<stdio.h> #include<stdlib.h> int main(void) { pid_t pid = fork(); pid = fork(); pid = fork(); if(pid == 0) { fork(); } fork(); return 0; }
Kaluti
asked
in
Operating System
Aug 20, 2017
by
Kaluti
1.4k
views
fork-system-call
operating-system
2
votes
1
answer
79
fork query
when fork is execute the child process has same virtual address space or physical address space ? when we print address of a variable in c ..what is it :->virtual address or physical address?
hem chandra joshi
asked
in
Operating System
Aug 20, 2017
by
hem chandra joshi
563
views
fork-system-call
11
votes
4
answers
80
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? How to solve this using tree diagram?
set2018
asked
in
Operating System
Jul 7, 2017
by
set2018
9.3k
views
operating-system
fork-system-call
1
vote
1
answer
81
fork system call
How many process are created by the program? int main(){ int i; for(i=0;i<4;i++) fork(); return 0; } Can I write like this ? fork(); fork(); fork(); fork();
set2018
asked
in
Operating System
Jul 7, 2017
by
set2018
7.8k
views
operating-system
fork-system-call
2
votes
2
answers
82
working of fork() system call
How many times "hello" gets printed? main() { fork(); fork(); printf("hello"); }
set2018
asked
in
Operating System
Jul 7, 2017
by
set2018
11.4k
views
fork-system-call
operating-system
1
vote
0
answers
83
Recursive fork()
The pid_t data type is a signed integer type which is capable of representing a process ID. getpid() returns the process ID of the current process The wait() system call suspends execution of the calling process until one of its children terminates. wait(): on ... } PS : some of the system call and macro definitions are simplified for the sake of the QS as well as for simplicity.
dd
asked
in
Operating System
Jun 2, 2017
by
dd
2.1k
views
fork-system-call
operating-system
15
votes
5
answers
84
ISRO2017-51
Wha is the output of the following program? main() { int a = 10; if(fork()) == 0)) a++; printf("%d\n",a); } 10 and 11 10 11 11 and 11
sh!va
asked
in
Operating System
May 7, 2017
by
sh!va
8.7k
views
isro2017
operating-system
fork-system-call
3
votes
4
answers
85
Gatebook_Mocktest2(Operating Systems)
Process executes the following code for (i=0;i<5,i++) for (j=0;j<5,j++) fork(); The no of child processes created is ?
smartmeet
asked
in
Operating System
Feb 7, 2017
by
smartmeet
1.0k
views
operating-system
fork-system-call
0
votes
0
answers
86
Madeeasy Test Series
What is the answer to this problem? I am getting 10 as an answer.
Akhilesh Yadav 1
asked
in
Operating System
Dec 23, 2016
by
Akhilesh Yadav 1
551
views
fork-system-call
0
votes
1
answer
87
fork behaviour
#include <stdio.h> #include <sys/types.h> #define MAX_COUNT 200 void ChildProcess(void); /* child process prototype */ void ParentProcess(void); /* parent process prototype */ void main(void) { pid_t pid; pid = fork(); if (pid == 0) { int x1= 112; float ... printf(" *** Child process ***\n"); } void ParentProcess(void) { printf("*** Parent*****\n"); }
vaishali jhalani
asked
in
Operating System
Nov 27, 2016
by
vaishali jhalani
747
views
programming-in-c
fork-system-call
operating-system
3
votes
1
answer
88
fork() system call
MY QUESTION IS 1)WHY PRINTF() PRINT VIRTUAL ADDRESS(MENTIONED IN EXPLANTION) NOT PHYSICAL ADDRESS 2) WHY VIRTUAL ADDRESS(O/P OF PRINTF(&VAR)) OF A VARIABLE CHANGES WHEN WE RUN A PROGRAM MANY TIMES Consider the following code fragment: if (fork() = ... process and virtual address of a' doesn't change in child process. Therefore, we get same addresses in both parent and child.
indrajeet
asked
in
Operating System
Nov 20, 2016
by
indrajeet
1.9k
views
operating-system
fork-system-call
programming-in-c
2
votes
0
answers
89
fork() system call
int main(void) { if(fork() && fork()) { fork(); } if(fork() || fork()) { fork(); fork(); } printf("\nGate 2017\n"); } How many times "Gate 2017" will be printed?
dd
asked
in
Operating System
Oct 24, 2016
by
dd
1.3k
views
operating-system
fork-system-call
2
votes
0
answers
90
fork() system call
for(i=1;i<=3;i++) { fork(); printf("x"); } How many times 'x' is printed ?
dd
asked
in
Operating System
Oct 24, 2016
by
dd
1.1k
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:...