Question 13873 – UGC NET JRF November 2020 Paper-2
November 28, 2023
Question 13875 – UGC NET JRF November 2020 Paper-2
November 28, 2023
Question 13873 – UGC NET JRF November 2020 Paper-2
November 28, 2023
Question 13875 – UGC NET JRF November 2020 Paper-2
November 28, 2023

UGC NET JRF November 2020 Paper-2

Question 19
Assuming that the system call fork () never fails, consider the following C programs P1 and P2 executed on a UNIX/ Linux system:

Statement I: P1 displays “Happy” 8 times.
Statement II: P2 displays “Happy” 12 times.
In the light of the above statements, choose the correct answer from the options given below:
A
Both Statement I and Statement II are true
B
Both Statement I and Statement II are false
C
Statement I is correct but Statement II is false
D
Statement I is incorrect but Statement II is true
Question 19 Explanation: 
As we know that “n” fork calls will lead to 2n-1child processes. Hence Total no. of process will be 2n-1+1(We added 1 for the parent process).
Now since in P1 all 3 fork calls are done before the printf statement so all 8( 23-1+1) processes will execute the Printf statement. Hence in P1 Printf statement will be executed for 8 times.
Correct Answer: C
Question 19 Explanation: 
As we know that “n” fork calls will lead to 2n-1child processes. Hence Total no. of process will be 2n-1+1(We added 1 for the parent process).
Now since in P1 all 3 fork calls are done before the printf statement so all 8( 23-1+1) processes will execute the Printf statement. Hence in P1 Printf statement will be executed for 8 times.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!