Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and x V operations were completed on this semaphore. If the final value of semaphore is 5, x will be





Solution

Initial semaphore value = 7


Each P operation decreases the value by 1.


Each V operation increases the value by 1.


So,


$7 - 20 + x = 5$


$x - 13 = 5$


$x = 18$



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...