title: getpid and getppid return two different values
body: <p>When I run the code below </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;sys/types.h&gt;
  //int i=0;
  int main(){
  
  int id ;
  id = fork() ;
  printf("id value : %d\n",id);
      if ( id == 0 )
      {
      printf ( "Child : Hello I am the child process\n");
      printf ( "Child : Child’s PID: %d\n", getpid());
      printf ( "Child : Parent’s PID: %d\n", getppid());
      }
      else
      {
      printf ( "Parent : Hello I am the parent process\n" ) ;
      printf ( "Parent : Parent’s PID: %d\n", getpid());
      printf ( "Parent : Child’s PID: %d\n", id);
      } 
  
  }
  </code></pre>
  
  <p>My output is</p>
  
  <pre><code>id value : 20173
  Parent : Hello I am the parent process
  Parent : Parent’s PID: 20172
  Parent : Child’s PID: 20173
  id value : 0
  Child : Hello I am the child process
  Child : Child’s PID: 20173
  Child : Parent’s PID: 1
  </code></pre>
  
  <p>How can the parent's PID(20172) differ from the child's parent's ID (1)? Shouldn't those two be equal?</p>