Pipelining Processes

We have some rules here, and one of them is:
(6) Do not post classroom or homework problems.

But this code looks like a mess. I'll bend the rules a tad and make a few remarks. They all apply to your first post. I'm ignoring your second post which seems to be a fragment that doesn't fit it the the first post.

By default fd 1 is standard out and you can do a printf and see the result. Screw up fd 1, and now you have no more printf output. That is what you're doing here. I haven't run your code, but I've stared at it for awhile. I think the children are calling printf but with a trashed fd 1. This is one of several reasons why you should use stderr rather than stdout to debug stuff. So switch to fprintf(stderr,....) and stuff will be more clear.

Think about the first child process... it does:
dup2(fd[1],1);
if((close(fd[0])<0)||(close(fd[1])<0)) die("close-1 failed");
break;
so its fd 1 is no longer the terminal, it's the pipe. When the child printf's the data will be available to the parent on fd 0. Then child breaks out and dutifully calls printf, returns, and calls findfib. But it's all for naught since the parent never reads this data on fd 0. Worse than that, the parent loops and spawns another child. Each child in turn is connected briefly to the parent's fd 0. The last child stays connected, but the parent still never reads any data from the pipe.

This program is not doing anything to find Fibonacci numbers. When I taught C, I had my students find a Fibonacci number via recursion which makes a bit more sense than this. And I would settle for the 20th Fibonacci number. F(199)=173402521172797813159685037284371942044301 and even if you use 64 bit unsigned integers, the largest integer available to you is 18446744073709551616. Special techniques are required to deal with very large integers and they are beyond what a beginning C programmer can handle.

I take a dim view of your instructor's assignment, his code, and his policy of not being available to you for questions. This is why I bent the rules a bit here. Don't expect regular help with homework.

Reference: The first 300 Fibonacci numbers, completely factorised