1. looping help

assuming cols=2 and rows=3
([0,0][0,1]
[1,0][1,1]
[2,0][2,1])

Code:
```int i=0;
cout<<"cols="<<cols<<endl;
cout<<"rows="<<rows<<endl;
cout<<endl;
do{
j=0
cout<<"Number at position "<<i<<","<<j<<" is ";
j++;
if(j=cols)
{i++;}
else
{cout<<"Number at position ("<<i<<","<<j<<") is ";
}while(j<=cols);```
how can i edit this little bit of code to loop back to the beginning, i know i need to have j restart at 0, thats why the j=0 in inside the code and not out. Do i need to put a do loop inside the loop to take care of the i++ part of the code?

I have been coding straight for pretty much the better part of 2 day, and i'm hoping a fresh and/or more experienced set of eyes can help give me some insight as to what i have to do.

thanks

2. i revised my code to
Code:
```int j;
int i=0;
cout<<"cols="<<cols<<endl;
cout<<"rows="<<rows<<endl;
cout<<endl;
do{
j=0;
cout<<"Number at position "<<i<<","<<j<<" is ";
do{
j++;
if(j=cols)
{i++;}
else
{cout<<"Number at position ("<<i<<","<<j<<") is ";
}while(j!=cols);
}while(i!=rows);```
and am not getting outputs for the first column
[has value][no value]
[has value][no value]
[has value][no value]

small progress, but knowing my luck, i may have taken a step backwards

3. revised yet again, new code is
Code:
```int j;
int i=0;
cout<<"cols="<<cols<<endl;
cout<<"rows="<<rows<<endl;
cout<<endl;
do{
j=0;
cout<<"Number at position "<<i<<","<<j<<" is ";
while(j<cols)
{j++;
cout<<"Number at position ("<<i<<","<<j<<") is ";
}
i++;
}while(i<rows-1);

i=0;
j=0;

do{
j=0;
cout<<matrix[i][j]<<" ";
while(j<cols)
{j++;
cout<<matrix[i][j]<<" ";
}
i++;
cout<<endl;
}while(i<rows-1);```
only problem is now instead of outputting data like
[1][2]
[3][4] it is outputting data like [1][2][3]
[5][6] it is outputting data like [4][5][6]

4. You print the first element in every row twice (once before the loop and once in the loop). (You also appear to not print the last row at all, since the loop on i stops way early.)