0% found this document useful (0 votes)
4 views1 page

1A (C) - Mycompiler

hand book

Uploaded by

thejasnaikrh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

1A (C) - Mycompiler

hand book

Uploaded by

thejasnaikrh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

myCompiler

1A

an anonymous user · just now

C ▶  

1 #include<stdio.h>
2 #include <unistd.h>
3 #include<sys/types.h>
4 int main()
5 {
6 int id,childid;
7 id=getpid();
8 if((childid=fork())>0)
9 {
10 printf("\n I am in the parent process %d
11 printf("\n I am in the parent process %d
12 printf("\n I am in the parent process %d
13 }
14 else
15 printf("\n I am in child process %d",id)
16 printf("\n I am in the child process %d"
17 printf("\n I am in the child process %d"
18 }

Program input

Output

I am in child process 30
I am in the child process 31
I am in the child process 30
I am in the parent process 30
I am in the parent process 30
I am in the parent process 9

I am in the child process 30


I am in the child process 9
[Execution complete with exit code 0]

The Frontend Masters Knowledge


Quest Sale ends soon! Accelerate
from mid-level to senior developer.

ADS VIA CARBON

Comments

Please sign up or log in to contribute to the


discussion.

Supported languages
Deno JavaScript NodeJS

Python Ruby Go

C C++ Java

C# TypeScript PHP

Bash R Octave
(MATLAB)

Fortran Lua Erlang

SQL MySQL MongoDB

Clojure D Perl

Kotlin Swift Rust

Assembly

Programming guides | Terms of service |


Privacy policy | Contact us | © 2019 - 2024
mycompiler.io.

You might also like