How many times the following code will print "techtud" ?

main(){
p = fork();
if(p > 0){
fork();
printf("techtud");
}
printf("techtud");
}

Hradesh 10 Jan 2017 11:24 pm

thks sir

priyanka gautam 10 Jan 2017 11:43 pm

great sir.... thanku

Vivek Vikram Singh 11 Jan 2017 05:43 pm
Techtud Admin 11 Jan 2017 05:48 pm

This is a nice example, Let's include it into preparation.

Shivesh Kumar Roy 11 Jan 2017 10:02 pm

Thanks a lot pritam Prasun sir for such an awesome video, It basically cleared all the co-concepts related to fork() system call. I really appriciate your effort.