Print 10 Integers per Line

The code I have is below. Im able to print them all onto one line but I need to print 10 per line separated by commas and Im not sure how to do that ):


1
2
3
for (int i = 0; i < MAXVALUE; i++){
		for (int j = 0; j < counts[i]; j++){
			output << i << ",";
Basically check if the current is 10th and if true put a newline after it.
1
2
3
4
5
6
for (int i = 0; i < MAXVALUE; i++){
	output << i << ",";
	if (i == 10th number) { // Just create this line
		output << '\n';
	}
}
Last edited on
Topic archived. No new replies allowed.