🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Processes and Threads: all 10 questions

Quiz: Processes and Threads · Question 6 of 10

What does fork() return in the child process?

What does fork() return in the child process?

  1. A.0
  2. B.The child's PID
  3. C.The parent's PID
  4. D.−1
Answer & explanation

Correct answer: 0

The parent receives the child's PID; the child receives 0. A return value of −1 means fork failed.

Can you get the rest right without peeking?

Take the timed Quiz: Processes and Threads quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →