Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Child processes - Example - Operating System
Home
>>
Category
>>
Programming Language (MCQ) questions
>>
Operating System
Q. A process executes the code,
fork();
fork();
fork();
How many child processes are created?
- Published on 26 Aug 15
a.
5
b.
8
c.
7
d.
9
ANSWER: 7
Related Content
Networking (
207
)
Database (
97
)
C programming (
58
)
Software Engineering (
28
)
SQL (
5
)
HTML (
74
)
Web Technologies (
11
)
Data Structure (
140
)
Operating System (
96
)
Java (
25
)
Oracle (
5
)
C++ (
50
)
Algorithms (
7
)
PL/SQL (
13
)
JavaScript (
7
)
XML (
0
)
CSS (
1
)
Discussion
Nirja Shah
-Posted on 23 Nov 15
- Let's put some label names for the three lines
fork (); // Line 1
fork (); // Line 2
fork (); // Line 3
- Line 1 will create one child process
- Line 2 will create two child processes
- Line 3 will create four child processes
- A direct formula can be used to get the number of child processes.
- When there are n fork statements, there are always 2
n
– 1 child processes.
➨
Post your comment / Share knowledge
Required!
Required!
Invalid Email Id!
Required!
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
MCQs
English
Tutorials
Download
▲