Question: Including the initial parent process, how manyprocesses are created by the program? And what is the value of ibefore each process terminates? Please draw the parent-childprocess hierarchy to justify your answer.
#include
#include
int main() {
         int i =0;
         if(fork() == 0) {
                   ++i;
                    if (fork() != 0)
                            i = 3;
                    else
++i;
      fork();
         }  else  {
                     i = 5;
                     if (fork() == 0)
                                   ++i;
          }
          return 0;
}
I could really use a longer explanation of this problem. I haveseen the answer but I still don't really understand how to get tothe answer. Any help would be greatly appreciated.