Explanation : Condition “if” will be satisfy for i = 0, 2, 4, 6, 8 only. So, “fork()” will call for 5 times.
Total number of processes created is,
= 2number of fork()
There is always only one parent process of these processes and remaining will be child processes.
Hence number of child process created is,
= 2number of fork() - 1
= 25 - 1
= 32 - 1
= 31
So, option (A) is correct
Explanation : Given, “for” loop will run from i=0 to 4.
i = 0
sum = 0+ 10 – 10 = 0
i = 1
sum = 0 + 9 – 8 = 1
i = 2
sum = 1 + 8 – 6 = 3
i = 3
sum = 3 + 7 – 4 = 6
i = 4
sum = 6 + 6 – 2 = 10
Now, loop terminate and value of sum (i.e., 10) will be printed.
So, The output of above C program is 10.
Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a, b, d, $}, then the answer should be 3210)
Explanation : Given an array of 25 distinct elements, and pivot element is chosen uniformly randomly. So, there are only 2 worst case position in the pivot element is either first (or) last.
Therefore, required probability is,
= 2/25
= 0.08
So, option (A) is correct.