Open In App
Related Articles

ISRO | ISRO CS 2016 | Question 42

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will be (A) 18 (B) 22 (C) 15 (D) 13

Answer: (A)

Explanation: P operation : Decrements the value of semaphore by 1 V operation : Increments the value of semaphore by 1 Initially, value of semaphore = 7 After 20 P operations, value of semaphore = 7 – 20 = -13 Now, after xV operations, value of semaphore = 5 -13 + xV = 5 xV = 5 + 13 = 18 So, option (A) is correct.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 26 Mar, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads