Question: 5 . 9 . Consider the following program: boolean blocked [ 2 ] ; int turn; void P ( int id ) Line 2 :
Consider the following program:
boolean blocked ;
int turn;
void P int id
Line : int turn semi colon at indentation level
Line : void P open parenthesis int i d close parenthesis at indentation level
Line : open curly bracket at indentation level
Line : Blank.
Line : while open parenthesis true close parenthesis open curly bracket at indentation level
Line : blocked open square bracket i d close square bracket equals true semi colon at indentation level
Line : while open parenthesis turn logical not equal to operator i d close parenthesis open curly bracket at indentation level
Line : while open parenthesis blocked open square bracket minus i d close square bracket close parenthesis at indentation level
Line : forward slash asterisk do nothing asterisk forward slash semi colon at indentation level
Line : turn equals i d semi colon at indentation level
Line : close curly bracket at indentation level
Line : Blank.
Line : forward slash asterisk critical section asterisk forward slash at indentation level
Line : blocked open square bracket i d close square bracket equals false semi colon at indentatio
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
