Examveda

How many times printf() will be executed in the below mentioned program?
main() 
{
      int i;<br><br>       
      for (i = 0; i < 4; i++)      
      fork();
      printf("my pid = %d\n", getpid());
}

A. 4

B. 8

C. 16

D. 32

Answer: Option C


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux