The following C program main() { fork() ; fork() ; printf ("yes"); } If we…

ISRO Scientist/Engineer SC · 2018 · Computer Science

The following C program

main()
{
    fork() ; fork() ; printf ("yes");
}

If we execute this core segment, how many times the string yes will be printed ?

  1. A.

    Only once

  2. B.

    2 times

  3. C.

    4 times

  4. D.

    8 times

Attempted by 872 students.

Show answer

Correct answer: C

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…