try two for loops...one embedded into the other
for (i = 0; i < num; ++i)
{
for (j = 0; j < num2; ++j)
{}
}
gerard4143
Nearly a Posting Maven
2,295 posts since Jan 2008
Reputation Points: 512
Solved Threads: 397
Skill Endorsements: 0
Thanks for quick reply. What do you mean by num and num2 in the above code. Will i have to declare num and num2.
Its just an example that I made up..The numbers signify nothing.
gerard4143
Nearly a Posting Maven
2,295 posts since Jan 2008
Reputation Points: 512
Solved Threads: 397
Skill Endorsements: 0
Its just an example that I made up..The numbers signify nothing.
It doesn't matter, if she follows your advise she will get a square.
Can anyone please do the complete program for this so that stars are printed in the manner as given above.
Then you'll learn nothing.
Some clue:
One loop inside another one as previously said.
Outer loop is the number of rows.
Inside loop number of stars for each row printed minus one less than previous row.
Aia
Nearly a Posting Maven
2,394 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 220
Skill Endorsements: 14