GATEverse Practice, past papers & mock tests
GATE 2026 · CS1 - Forenoon
Operating SystemsProcess Management-IhardNAT2 marks
Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process.
c
int main () {
  int i;
  for (i = 0; i < 3; i++){
    if (fork() == 0){
      continue;
    }
    break;
  }
  printf("Hello!");
  return 0;
}
The total number of times that the printf statement gets executed is ________. (answer in integer)
Save your progress

Related Operating Systems PYQs