in Operating System edited by
643 views
0 votes
0 votes
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
int value = 5;
int main()
{
    pid t pid;
    pid = fork();
    if (pid == 0) { /* child process */
        value += 15;
        return 0;
    }
    else if (pid > 0) { /* parent process */
        wait(NULL);
        printf("PARENT: value = %d",value); /* LINE A */
        return 0;
    }
}

Explain what the output will be at LINE A in this program.

in Operating System edited by
643 views

1 comment

20
0
0

1 Answer

0 votes
0 votes

PARENT: VALUE = 5

Related questions