A process executes the following segment of code : for(i = 1; i < = n; i++)…

GATE · 2004 · IT

A process executes the following segment of code :

 for(i = 1; i < = n; i++)

fork (); 

The number of new processes created is  

  1. A.

    n

  2. B.

    ((n(n + 1))/2)

  3. C.

    2n - 1

  4. D.

    3n - 1

Attempted by 1072 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…