Continuing the loop in a new line

I'm writing the calendar program for my class, but I'm having problem to start a new line on Saturday and continue the loop.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  int main()
{
	int day;
	int numbDays;
	int offset;
	cout << "Number of days: ";
	cin >> numbDays;
	cout << "Offset: ";
	cin >> offset;

	cout << "  Su  Mo  Tu  We  Th  Fr  Sa\n";
	for (int day = 1; day <= numbDays; day ++)
	{
		cout << "   " << day; 
}
	if (day >= 8)
       cout << " \n";
          
       
    return 0;
 }


Any suggestions?

Thanks,
Take a look at how modulus % works: http://www.cplusplus.com/reference/functional/modulus/
 
if(day % Sa == 0)


You will also want to put it inside the for loop.
thanks,

=]
Topic archived. No new replies allowed.