It can be achieved using the modulo-operator. Do you know modulo from math? I can explain if not. Here is code:
1 2 3 4 5 6
for (int i = 0; i < 100; i++) {
cout << i; // print number to screen.
if (i % 7 == 0) { // this means that an integer 'n' exist so, that ' i = 7 * n + 0 '
cout << endl;
}
}