M
mark
for(int k=0;k<50;++k)
{if(k==10 || k==20 || k== 30 || k==40)
cout<<endl;}
else
cout<<" "<<k<<" ";
}
this prints as follows
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17....
ie the numbers are not left or right aligned or appear in neatly
arranged columns.
How to get the numbers printed so that they appear (like left aligned)
in neatly arranged columns like below
1 2 3 4....
11 12 13 14...
21 22 23 24...
{if(k==10 || k==20 || k== 30 || k==40)
cout<<endl;}
else
cout<<" "<<k<<" ";
}
this prints as follows
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17....
ie the numbers are not left or right aligned or appear in neatly
arranged columns.
How to get the numbers printed so that they appear (like left aligned)
in neatly arranged columns like below
1 2 3 4....
11 12 13 14...
21 22 23 24...