Instead of doing a nested loop, simply print the end of line when we reach the number of printed columns, or the last character of data has been written.
The only change in the output is the line number, which moved slightly due to the change in code.
Instead of doing a nested loop, simply print the end of line when we reach the number of printed columns, or the last character of data has been written.
The only change in the output is the line number, which moved slightly due to the change in code.