title: Ring of processes using fork() and pipes
body: <p>I've been wracking my brain about this problem during an hour. I have to create a ring of processes with n processes (quantity is passed as an argument via cmd). The parent process sends his PID to his first child, and this one sends his parent's PID plus his own PID to his next brother, and it happens until we have created n children. After that, the parent process gets the addition of the PID of all his children.</p>
  
  <p>Let's suppose that the parent process' PID is 3400 and we create two children, so the ring is made of three processes</p>
  
  <p>3400 + 3401(first child's PID) + 3402(second child's PID) = 10203</p>
  
  <p>The parent process should get this 10203.</p>
  
  <p>I have thought about one "for" loop in which child processes send the addition of their brothers PID from brother to brother, using only one pipe. Nonetheless, I haven't come across a solution yet.</p>