The operator %is the module operator (integer division). Thus, every five iterations of the loop, your program displays a character \n(new line).
Values will be:
Iteration i%5 value
i=1 1
i=2 2
i=3 3
i=4 4
i=5 0
i=6 1
i=7 2
i=8 3
i=9 4
i=10 0
So, every five prints, \n(new line) will be printed to standard output.
Hope this helps.