49.7k views
3 votes
What will be the output of the following program? #include #include #include int value = 5; int main(){ pid_t pid; pid=fork(); if(pid==0){ printf("I am the child process.\\"); value+=15; } else if(pid>0){ wait(NULL); printf("I am the parent process, value=%d", value); exit(0); } }

User Mattgabor
by
5.2k points

1 Answer

5 votes

Answer:

The output of this program is:

I am the child process.

I am the parent process, value=5

Step-by-step explanation:

The output of any given program is the generated result after a program execution.

At the end of writing any program, the output is gotten when the programmer hits the enter button to run the program.

Check attachment for output of the program.

What will be the output of the following program? #include #include #include int value-example-1
User Takuya
by
5.9k points