>But then i have to modify the inner loop to instead of starting
>from 1 each time, start from a value that increments the start value.
Currently you set numCtrl to 1. What happens when you set it to 1 + linCtrl? :)
>Lastly, the spacing.... crap....
Add another loop next to the numCtrl loop that prints the correct number of spaces.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>It returns 9 and 9 spaces below it before the return statement
Good. And what happens when you change numCtrl <= lineCtrl to numCtrl <= limit ? I'm basically forcing you to do the experimentation that you should be doing with these questions, by the way.
>About the spacing: You mean write another nested for loop?
Yep, you can do that:
for ( int i = 0; i < 10; i++ ) {
for ( int j = 0; j < i; j++ )
cout<<' ';
for ( int k = 0; k < i; k++ )
cout<<'*';
cout<<'\n';
}
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
If you want to do that, do it. Output the loop index.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
chubbs1900>I am trying to self teach C++ and I am to the point of loops. ...
adatapost>Tryout.
1.
1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 1 1 1 1
2.
1 0 0 0 1
0 1 0 1 0
0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
3.
1
2 4 3
5 7 9 10 8 6
11 13 15 17 18 16 14 12
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241