GATEverse
← GATE CSE 2015 Set 1

Q9

NAT1 mark

The following two functions P1P1 and P2P2 that share a variable BB with an initial value of 22 execute concurrently.

P1() { P2(){ C = B - 1; D = 2 * B;  B = 2 * C; B = D - 1;}}\begin{array}{|l|l|}\hline \text{P1() \{ } & \text{P2()\{} \\ \text{ C = B - 1;} & \text{ D = 2 * B; } \\ \text{ B = 2 * C;} & \text{ B = D - 1;} \\ \text{\}} & \text{\}} \\\hline \end{array}

The number of distinct values that BB can possibly take after the execution is______________________.

Sign in to save attempts.

Loading…