I wrote a program in c++ that is made up of two for loops like this:
for(int i=1; i<3; i++)
{
for(int j=1; j<3; j++)
{
cout<<j<<"\t"<<2*j*i<<endl;
}
}
with output:
1 2
2 4
1 4
2 8
But I’m not interested in output with format like this, what I’m looking for is that after the first for loop over j with i=1 is finished, the output of the for loop over j with i=2 prints in a new column like below.
1 2 1 4
2 4 2 8