Consider a single CPU system with two active processes A and
Solution
Given that 3 scenarios
(a) process A needs to read frm a file
When there is a need of input or output for the current running process, then the process will do its work, mean while CPU will be allocated to other waiting processes, in this scenario CPU is given to process B.
(b) When process executes divide by zero
Based on the language processor results in different manner, before computing the operations it checks the operation type, based on that it returns error message or crash or failure of system.
Divide by zero is undefined and the result of undefined computation or an non halting one is the undefined value.
Divide by zero is not defined on integers, so it should produce by raising by an error or failing to terminate
(C) Timer interruts when proess B is running:
When timer interrupts the running process B, then the process B is taken out from the processing and kept in ready queue for next execution, and CPU given to the next ready process that means A.
Now A will be executing, if A finished it\'s execution then again B will be executed.
