Code:
fprintf(file, "%d%c", j, (i % SIZE) == (SIZE - 1) ? '\n' : ' ');
Since SIZE is 5 in this example, the last parameter reduces to
Code:
(i % 5) == 4 ? '\n' : ' '
For i == 0, i % 5 == 0, so a space goes with the %c.
For i == 1, i % 5 == 1, so a space goes with the %c.
...
For i == 4, i % 5 == 4, so a newline goes with the %c.
For i == 5, i % 5 == 0, so a space goes with the %c.
...