A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. Consider the following code fragment:

if (fork() == 0)
{ a = a + 5; printf("%d,%d\n", a, &a); }
else { a = a –5; printf("%d, %d\n", a, &a); }

Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?
a. u = x + 10 and v = y
b. u = x + 10 and v != y
c. u + 10 = x and v = y
d. u + 10 = x and v != y
Answer:u + 10 = x and v = y
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions:



View All Questions on: Process Synchronization