Gate CS-2015-1 Question Paper With Solutions

Q. 19 The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.

P1() 
{ 
   C = B – 1; 
   B = 2*C;  
}

P2()
{
   D = 2 * B;
   B = D - 1; 
}

The number of distinct values that B can possibly take after the execution is
______.

Answer: (A)

Explanation:

Gate CS-2015-1 Question Paper With Solutions Gate CS-2015-1 Question Paper With Solutions Gate CS-2015-1 Question Paper With Solutions

Learn More:   Gate EE-2012 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here