Use for loops to print the stars, the spaces, etc. The standard for loop structure is one of the following two
for( int i = 0; i < numberOfTimes; i++ )
for( int i = 1; i <= numberOfTimes; i++ )
for loop number of lines
{
for loop spaces
{print space
}for loop stars
{print star, print space
}
print newline
}
}
Edit:
BTW, the number of spaces to print is equal to the TotalNumberOfLines - CurrentLineNumber
The number of stars to print is equal to the CurrentLineNumber
Last edited by c++noobie; Jan 7th, 2009 at 3:00 am.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
Offline 71 posts
since Feb 2008