GATE CS 2025, set 1 · Question 29 · Operating System · Numerical answer (NAT) · 1 mark · no negative marks
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is ______. (Answer in integer)
int main() int x=0,i=0; scanf("%d", x); for(i=0; i<20; i++) x = x+20; printf("%d ",x); return 0;
Answer
Answer 21
Answer from the official GATE CS 2025 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes