if(minrange<maxrange)
{
cout <<"The numbers that are divisible by " <<increment<<" are ";
cout <<endl;
for(count=minrange; count<=maxrange; count++)
{
if(count%increment==0)
{
cout <<count <<" , ";
sum1 = sum1+count;
}
}
this is the code that i wrote. The code is working fine. However, my problem is that every 5 numbers that its going to print out there has to endl.
For example,
5, 10, 15, 20, 25
30, 35, 40, 45, 50
55, 60, 65, 70, 75
like this.
However my code will write 5, 10, 15, 20, 25, 30, 45, 50, 55, 60, 65, 70 all in one line which is causing me problem.
How would i solve this problem? since its in for loop i can't put endl in for loop because it will read the endl command every loop and make the numbers look like this
5
10
15
20
25
30
35
etc...
plz help me!!