0 votes 0 votes what is output? Operating System operating-system fork-system-call general-topic-doubt + – arun_singh asked Aug 4, 2018 • retagged Mar 9, 2019 by Abdul Wazeed arun_singh 618 views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply goxul commented Aug 4, 2018 reply Follow Share Did you try running it? 0 votes 0 votes Shaik Masthan commented Aug 4, 2018 reply Follow Share a,b,c variables are different for each process. Let say your parent process is P0 and after fork you get P1 then P0 have a,b,c which represent P0.a,P0.b and P0.c P1 have a,b,c which represent P1.a,P1.b and P1.c 0 votes 0 votes Soumya29 commented Aug 4, 2018 reply Follow Share Compilation error- $d \ undeclared$ \\because of last print statement. Small example code- https://ideone.com/TL5arw 1 votes 1 votes Shaik Masthan commented Aug 4, 2018 reply Follow Share At last line, you are accessing d, it is not exist for Parent process, it exist only for ( which is children process of original parent process ) P1 and it's childrens due to d declare with in if block of first fork() 0 votes 0 votes Soumya29 commented Aug 4, 2018 reply Follow Share @Shaik sir, last print statement will give an error in the child process too. Scope of variable "d" is within $if$ block only but that print statement is outside that block. 0 votes 0 votes arun_singh commented Aug 4, 2018 reply Follow Share Got it. 0 votes 0 votes Shaik Masthan commented Aug 4, 2018 reply Follow Share @Soumya29, yes mam, you are right. 0 votes 0 votes Please log in or register to add a comment.