What is the output of the following program? main() { int a = 10; if ((fork()…

ISRO Scientist/Engineer SC · May 2017 · Computer Science

What is the output of the following program?

main()
{
    int a = 10;
    if ((fork() == 0))
        a++;
    printf("%d\n", a);
}
  1. A.

    10 and 11

  2. B.

    10

  3. C.

    11

  4. D.

    11 and 11

Attempted by 520 students.

Sign up free to check your answer

Sign up free

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…