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
1
vote
1
answer
1
#OS-FORK Output
Q23. The following C program is executed on a Unix/Linux system: main() { int i=0; while (i<20) if (i%2==0) fork(); i++; return 0; } Calculate how many number of processes will be created after executing the above program. Options: 1.1023 2.Infinite 3.1024 4.2048
BitMask
asked
in
Operating System
Mar 3
by
BitMask
207
views
operating-system
fork-system-call
gate-preparation
programming-in-c
usermod
5
votes
2
answers
2
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 41
Assume the following code is compiled and run on a modern Linux machine. Assuming $\textsf{fork()}$ never fails, how many times will the message $\textsf{ Hello }$ will be displayed? #include <stdio.h> #include <unistd.h> int ... else { printf("Hello"); } printf("Hello"); return 0; } $2$ $3$ $4$ $6$
GO Classes
asked
in
Operating System
Jan 21
by
GO Classes
745
views
goclasses2024-mockgate-12
goclasses
operating-system
fork-system-call
2-marks
2
votes
3
answers
3
System Call FORK()
Int main () { fork(); printf("a"); fork(); printf("b"); return 0; } How many distinct outputs are possible of above code? And also give outputs
Philosophical_Virus
asked
in
Operating System
Dec 10, 2023
by
Philosophical_Virus
733
views
operating-system
fork-system-call
3
votes
1
answer
4
fork
Consider the following code segment : int main (void) { for (int i=2; i<=5; i++) { fork( ); } printf (“GOCLASSES”); How many times “GOCLASSES” is printed by the above code?
24aaaa23
asked
in
Operating System
Oct 1, 2023
by
24aaaa23
700
views
operating-system
fork-system-call
0
votes
0
answers
5
fork
Consider the following pseudo code that uses fork–join constructs – S1 ; fork(L1); // fork(L) : Creates new process and execution starts from L. S2 ; S4 ;join( ) : Combines all processes able to execute join. fork(L2); L1 : S3 ; L2 join( ); S5 ; Draw correct precedence graph for the above code fragment?
24aaaa23
asked
in
Operating System
Oct 1, 2023
by
24aaaa23
369
views
operating-system
fork-system-call
1
vote
2
answers
6
OS handout
For following code how many times the '*' will printed? main() { int i,n ; for(i = 1 ; i<=n ; ++i) { fork(); printf("*"); } }
Aniket1710
asked
in
Operating System
Jul 20, 2023
by
Aniket1710
749
views
fork-system-call
0
votes
2
answers
7
Unacademy practice question from OS
#include <stdio.h> void main() { int i = 3; while(i>0) { i--; if(fork()||fork()) { printf("Hi"); } } } How many times “Hi” will be printed ?? #include <stdio.h> void main() { int i = 2; while(i>0) { i--; if(fork()||fork()) { printf("Hi"); } } } How many times “Hi” will be printed ??
vivek1211
asked
in
Operating System
Jul 5, 2023
by
vivek1211
831
views
operating-system
fork-system-call
0
votes
3
answers
8
#CPCB
How many helloWorld lines are printed by the program: #include <stdio.h> #include <stdlib.h> void myFunc() { if (fork() == 0) { fork(); printf(“helloWorld\n”); exit(0); } return ; } int main(){ printf(“helloWorld\n”); myFunc(); printf(“helloWorld\n”); return 1; }
amit166
asked
in
Operating System
Jun 30, 2023
by
amit166
527
views
fork-system-call
0
votes
1
answer
9
Fork() system call doubt
void main() { int n = 1; if(fork()==0) { n = n<<1; printf(“%d, “, n); n = n <<1; } if(fork()==0) n=n+700; printf(“%d, “,n); } Which of the following output is not possible? 2,4,1,701,704 1,2,4,704,701 2,704,4,701,1 1,704,2,4,701
Erwin Smith
asked
in
Operating System
Apr 11, 2023
by
Erwin Smith
737
views
fork-system-call
operating-system
programming-in-c
2
votes
3
answers
10
GO Classes 2023 | IIITH Mock Test 1 | Question: 27
When a process creates a new process using the $\textsf{fork()}$ operation, which of the following are shared between the parent process and the child process? Stack Heap Shared memory segments Page table
GO Classes
asked
in
Operating System
Mar 26, 2023
by
GO Classes
682
views
goclasses2023-iiith-mock-1
goclasses
operating-system
fork-system-call
1-mark
1
vote
1
answer
11
GO Classes 2023 | IIITH Mock Test 1 | Question: 28
Given the following piece of code: main(int argc, char ** argv) { int child = fork(); int c = 5; if(child == 0) { c += 5; } else { child = fork(); c += 10; if(child) c += 5; } } How many different copies of the variable $\textsf{c}$ are there? $2$ $3$ $4$ $1$
GO Classes
asked
in
Operating System
Mar 26, 2023
by
GO Classes
578
views
goclasses2023-iiith-mock-1
goclasses
operating-system
fork-system-call
1-mark
12
votes
3
answers
12
GATE CSE 2023 | Question: 13
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode? Function Call malloc Call Page Fault System Call
admin
asked
in
Operating System
Feb 15, 2023
by
admin
11.0k
views
gatecse-2023
operating-system
fork-system-call
multiple-selects
1-mark
0
votes
1
answer
13
Fork() | OS
int doWork(){ fork(); fork(); printf("Hello world!\n"); } int main() { doWork(); printf("Hello world!\n"); exit(0); }
abhinowKatore
asked
in
Operating System
Jan 13, 2023
by
abhinowKatore
1.4k
views
fork-system-call
operating-system
1
vote
3
answers
14
Unacademy AIMT question on Fork()
Given the following piece of code : Main() { Int child = fork(); Int c = 5; if (child == 5) { C + = 5; } Else { Child = fork(); C + = 5; } } What are the different values of the variable c? First of all checking child == ... a pseudocode as some of the syntaxes are wrong. Also I am getting the answer as 10,10,10. Given answer is 20,10,15. Can someone please check?
Sunnidhya Roy
asked
in
Operating System
Dec 14, 2022
by
Sunnidhya Roy
1.1k
views
operating-system
fork-system-call
programming-in-c
1
vote
0
answers
15
Fork System Call and Threads | OS | MSQ
MSQ Consider the following statements, which one of the following is/are TRUE In fork() system call, child process inherits all the open file descriptors of parent process In fork() system call, child process copies the code of the ... system call, child process shares the code of the parent process User level threads shares the code segment of the process
Souvik33
asked
in
Operating System
Nov 28, 2022
by
Souvik33
749
views
operating-system
fork-system-call
unix
process-and-threads
threads
multiple-selects
2
votes
1
answer
16
gateforum
h4kr
asked
in
Operating System
Nov 9, 2022
by
h4kr
307
views
gateforum-test-series
operating-system
fork-system-call
0
votes
1
answer
17
made easy test series
When a process create a child, which of the following is/are correct possibility/situation? A) Parent process can execute parallely with children. B) Parent process can wait until some or all of its children have terminated. C)Child process can only be the duplicate of parent process. D) Child process can only loaded with program other than parent program.
viral8702
asked
in
Operating System
Oct 12, 2022
by
viral8702
883
views
made-easy-test-series
fork-system-call
4
votes
2
answers
18
GO Classes Test Series 2023 | Operating Systems | Test 4 | Question: 8
Given the following piece of code main(int argc, char ** argv) { forkthem(5) } void forkthem(int n) { if(n > 0) { fork(); forkthem(n-1); } } How many processes are created if the above piece of code is run? (Hint: It may be easier to solve this problem by induction/recursion.)
GO Classes
asked
in
Operating System
Oct 9, 2022
by
GO Classes
368
views
goclasses2024-os-4-weekly-quiz
numerical-answers
goclasses
operating-system
fork-system-call
2-marks
Page:
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
(24)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(682)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
243k
comments
79.7k
users
Recent questions tagged fork-system-call
Recent Blog Comments
Hlo I'm Rupesh I got AIR 3485 in gate CS and AIR...
@Ajay Sasank here is the direct link...
Thank you for the post didi My GATE 2023 & 2024...
I Hope it helps 😊
Today's best post I seen thank you for motivation