1 votes 1 votes How many processes will be created when we run the below program? main ( ) { Printf (“Hi”); fork ( ); Printf (“Hello”); fork ( ); fork ( ); } (a) 3 (b) 6 (c) 7 (d) 8 Mak Indus asked Jan 11, 2019 Mak Indus 2.9k views answer comment Share Follow See 1 comment See all 1 1 comment reply balchandar reddy san commented Jan 11, 2019 reply Follow Share fork(); 1 child process gets created with id=0; //total processes=2 fork(); 2 child processes gets created with id's 0; //total processes=4 fork(); 4 child processes gets created with id's 0; // total processes=8 total no. of nodes created = 8-1(parent process) (or) 1+2+4 = 7 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes can you explain me in detail.. . Vamshi answered Oct 10, 2019 Vamshi comment Share Follow See all 2 Comments See all 2 2 Comments reply Ashwin1599 commented Dec 22, 2019 reply Follow Share when you call Fork() , 1 new child process (assume C1) gets created and parent process (P) remains as it is.And now when you call Fork() again for second time child process C1 creates it's own child process say C2 and it (C1) also remains there also parent P creates another child process assume C3 and so on as shown ... 1 votes 1 votes Vamshi commented Dec 22, 2019 reply Follow Share tqsm @Ashwin 1599 0 votes 0 votes Please log in or register to add a comment.