title: Printf statement not outputting
body: <p>Im still relatively new to C, I am currently trying to write a concurrent process program however whenever I get to the child process it only prints out the one section of Printf statements as follows:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/wait.h&gt;
  #include &lt;unistd.h&gt;
  
  int concurrent(int num, int numOfProcs, int *nump)
  {
    pid_t pid;
  
    pid = fork();
    if (pid &lt; 0)
    {
      perror(&quot;There was an error during fork call: &quot;);
      exit(1);
    }
  
    //child Processes
    if (pid == 0)
    {
      for (int i = 0; i &lt; numOfProcs; i++)
      {
        printf(&quot;\nBEFORE Increment, &quot;);
        printf(&quot; \nChild number: %d&quot;,i);
        printf(&quot; \nChild process ID: %d&quot;,(int) getpid());
        printf(&quot; \nCurrent value of num: %d&quot;, num);
        printf(&quot; \nCurrent value of nump: %d&quot;, *nump);
        printf(&quot; \nCurrent value of x: %d&quot;, x);
  
  
        x += 5;
        num ++;
        *nump++;
  
        printf(&quot;\nAFTER Increment, &quot;);
        printf(&quot; \nChild number: %d&quot;,i);
        printf(&quot; \nChild process ID: %d&quot;,(int) getpid());
        printf(&quot; \nCurrent value of num: %d&quot;, num);
        printf(&quot; \nCurrent value of nump: %d&quot;, *nump);
        printf(&quot; \nCurrent value of x: %d&quot;, x);
  
      }
      exit(0);
    }
    //parent process
    else
    {
      for(int i = 0; i &lt; numOfProcs; i++)
      {
        wait(NULL);
        printf(&quot;\nChild Process ended, Child PID: %d&quot;,(int) getpid());
      }
  
    }
  }
  
  
  int main (int argc, char *argv[])
  {
    char *a = argv[1];
    int numOfProcs = atoi(a);
    x = 10;
    int num = 50;
    int *nump = malloc(100);
    *nump = 100;
    
    printf(&quot;\nCurrent Values&quot;);
    printf(&quot;\nNumber of processes: %d&quot;,numOfProcs);
    printf(&quot;\nCurrent value of num: %d&quot;, num);
    printf(&quot;\nCurrent value of nump: %d&quot;, *nump);
    printf(&quot;\nCurrent value of x: %d&quot;, x);
  
    concurrent(num,numOfProcs,&amp;nump);
  
    exit(0);
  }
  </code></pre>
  <p>here is the output as of right now:</p>
  <pre><code>Current Values
  Number of processes: 2
  Current value of num: 50
  Current value of nump: 100
  Current value of x: 10
  BEFORE Increment,  
  Child number: 0 
  Child process ID: 35148 
  Current value of x: 10
  Child Process ended, Child PID: 35147
  Child Process ended, Child PID: 35147
  </code></pre>
  <p>Im just a bit confused on why its not outputting &quot;AFTER Increment&quot; and the rest of the print statements, any help would be greatly appreciated.</p>