c++ Nested for loops

Trying to implement A Double for loops that produces this output.

3
0 1 2 3
4
0 1 2 3 4
5
0 1 2 3 4 5


Here is my code
Please help.

#include <iostream>

int main()
{
for(int col = 3; col < 6; col++)
{
std::cout << '\n' << col << '\n';
for(int row = 1; row < 5; row++)
{
std::cout<< ' ' << row << ' ';
}

}
}
Last edited on
for(int row = 1; row <= col; row++)

Please always use code tags.
Last edited on
Topic archived. No new replies allowed.