Tutorials  Articles  Notifications  Login  Signup


Updated Jan. 22, 2020, 10:39 p.m. ⋅ 546 views

Fork() Function in C


//program to demonstrate the use of fork Function

Int main()

{

Printf("Hello");

Fork();

Fork();

}

This function will print 4 times Hello ,

Thats because fork Function clones the parent process and returns value either 0 or 1.

When it returns" 0" implies the "child"

And for parent  its "1".



HackerFriend Logo

Join the community of 1 Lakh+ Developers

Create a free account and get access to tutorials, jobs, hackathons, developer events and neatly written articles.


Create a free account