1. When the loop executes, fork called n times so,
Total no of new processes = $2^n -1$
2.Then Loop exits and next fork() executes( which is out of loop) then,
Total no of new processes becomes = 2 x $2^n -1$ =
Example: Let n = 2 then Loop runs 2 times and fork() makes 3 new processes(exclude parent) and After the loop exits
Next fork() executes makes two new processes of each previous 3 new processes and one new process from parent .so, total no of new processes = 7