0 0 votes printf("Hello"); if(!fork()) printf("World"); Operating System + – S Sarva Bhowma 679 views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Shaik Masthan commented Aug 18, 2018 reply Follow flag printf enclosed in if statement therefore it print only one time but now question is " is it print by parent process or child process? " fork() ---> return 0 for child process and non-zero for parent process therefore we can conclude that it will print by child process 1 1 replyShare arvin commented Aug 18, 2018 reply Follow flag first statement prints : hello. for second statement one more child process will be created.. for parent value of fork = +v3 number say (23) for chiild value of fork = 0 for if(!fork()) -----> only child process will execute... after second statement. printing world. and for parent process it comes out after second statement as (!23 =0) so answer will be HELLO WORLD 0 0 replyShare Please log in or register to add a comment.