Isosceles Triangle Nested For Loop HELP

Hello,

I am just a beginner in programming, i'm just in my first year so i dont know many things in C++.. My professor gave us a project that will create an isosceles triangle that measures 5 in its two sides and 9 for the base.. I tried searching but still i cannot do the program, we are only allowed to use nested for loop.. this should be the output..

    #
   # # 
  #   #
 #     #
#########



Please help me. :(
you must put the number and the pyramid depends of that number or what.. i don't understand your question. if it is not depends then you must only use 'cout' function. Please explain the whole problem clearly.
Since you're not allowed to move the console cursor
backwards, you'll have to write something that prints...

This:
     #     

Then, this:
    # #    

Then, this:
   #   #   

etc...

You could use a for loop inside which you'd print one such line per iteration.

The first and the last line could be treated as special cases.
For the rest of them, you could use a for loop to print the initial spaces,
then print a #, then use one more for loop for the second set of spaces,
and, finally, print another #.

Try doing it like this and see how it turns out.
If you think you need more help, show us your
code and we'll tell you what to fix/change.
Last edited on
Topic archived. No new replies allowed.