0 votes 0 votes printf("Hello"); if(!fork()) printf("World"); S Sarva Bhowma asked Aug 18, 2018 S Sarva Bhowma 435 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Shaik Masthan commented Aug 18, 2018 reply Follow Share 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 votes 1 votes arvin commented Aug 18, 2018 reply Follow Share 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 votes 0 votes Please log in or register to add a comment.