I am a beginner in MPI and I have a homework. I am not asking for you to solve it, I only need a hint on why my program is malfunctioning.
Here is the problem
For anyone who might be looking for the answer, i managed to find out that you should let one process handle all the printing.