Question: a ) Examine the following pseudo code in which p and q , defined as shown below. A , B , C , D ,

a) Examine the following pseudo code in which p and q, defined as shown below. A, B, C, D, and E atomic (indivisible) statements. Assume that the main program execute these two processes concurrently. (10 pts)
void p(){
C=B-1//1
B=2*C //2
}
void q(){
D=2*B //3
B=D-1//4
}
Initial value of B is 2.
Void main()
{
Parbegin p(), q()//Call method p() and method q() simultaneously
}
Considering all possible execution paths of this program explain how many different paths and how many different values of B can be obtained.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!