I kinda understand for loops.
I need help.this is what I am tring to accomplish!
1
12
123
1234
12345
123456
1234567
12345678
123456789
I know I need a for loop, but I get trapped using a for loop inside a for loop.
Printable View
I kinda understand for loops.
I need help.this is what I am tring to accomplish!
1
12
123
1234
12345
123456
1234567
12345678
123456789
I know I need a for loop, but I get trapped using a for loop inside a for loop.
This should work...
Code:for (maxnum = 1; maxnum <= 9; maxnum++)
{
for (num = 1; num <= maxnum; num++)
{
printf("%d", num);
}
printf("\n");
}