Help writing a for loop code

I am completely lost. I have to write a program using for loops and it must create the figure below:

<<<<<< ############ >>>>>>
<<<<<  ##########**  >>>>>
<<<<   ########****   >>>>
<<<    ######******    >>>
<<     ####********     >>
<      ##**********      >
       ************


Each output statement must write only one character constant. Also, states before writing the code, write the pseuodocode for the algorithm for the program, not sure how to start with that.
Writing pseudo code will certainly help. Pseudocode is basically code without syntax, or code in plain english.

Something like

loop for number of lines
{
loop for number of "<"
loop for number of "#"
...
...

decrement number of "<"
}
Here you are :)

1
2
3
4
5
6
7
8
9
10
for ( int i = 0; i < 7; i++ )
{
	for ( int j = 0; j < 7 - i - 1; j++ ) std::cout << '<';
	for ( int j = 0; j < i + 1; j++ ) std::cout << ' ';
	for ( int j = 0; j < 12 - 2 * i; j++ ) std::cout << '#';
	for ( int j = 0; j < 2 * i; j++ ) std::cout << '*';
	for ( int j = 0; j < i + 1; j++ ) std::cout << ' ';
	for ( int j = 0; j < 7 - i - 1; j++ ) std::cout << '>';
	std::cout << std::endl;
}
Thank you very much!
Topic archived. No new replies allowed.