Hey guys, I'm wondering if you can help me out on my problem. I wrote this code to print out consecutive numbers till it reach the maximum number entered. The code works but I want to control the output. Here's my code so far...
cout << "Enter max number: " << endl;
cin >> max;
int num = 1;
while (num <= max)
{
cout << num++ <<'\t';
}
cout << endl;
I want to control the output from this:
Enter max number:
10
1 2 3 4 5 6 7 8 9 10
Press any key to continue . . .
To this...
Enter max number:
10
1 2 3 4
5 6 7 8
9 10
Press any key to continue . . .
Thanks in advance!