how many times "welcome to the world" message will print ?">
what would be the output of the following program ?main (){printf ("welcome to the world");fork();}how many times "welcome to the world" message will print ?
The fork() system call will spawn a new child process which is an identical process to the parent except that has a new system process ID. Hence printf ("welcome to the world"); this statement execute infinite time
wizard
Feb 27th, 2007
It will print one time only, bzc after fork there is no printf statments. the printf statement is before fork so for parent it will print.