GATEverse Practice, past papers & mock tests
GATE 2024 · CS1 - Forenoon
Operating SystemsProcess Management-IhardNAT2 marks
Consider the following code snippet using the fork() and wait() system calls. Assume that the code compiles and runs correctly, and that the system calls run successfully without any errors.
c
int x = 3;
while(x > 0) {
  fork();
  printf("hello");
  wait(NULL);
  x--;
}
The total number of times the printf statement is executed is _______
Save your progress

Related Operating Systems PYQs