logo

Crowdly

Predict the output of the program given here. Assume that there is no mixing o...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Predict the output of the program given here.

Assume that there is no mixing of printf output on screen if two of them run concurrently.

In the answer replace a new line by a single space.

For example::

good

output

should be written as good output

--

int main() {

  int pid;

  printf("hi\n");

  pid = fork();

  if(pid == 0) {

    exit(0);

  }

  printf("bye\n");

  fork();

  printf("ok\n");

}

More questions like this

Want instant access to all verified answers on moodle.coep.org.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!