Hello!
I am new in this forum, and hope to learn new things here. I am very glad to join!
I need to write a program that prints a triangle like this:
*
*$*
*$$$*
*$$ $*
*$$ $$$*
*$$$$ $$$*
*$ $$$$$ $*
* $$$$$ $$$$*
*****************
The picture isn't very accurate, but as you can see, this is a triangle with $ spaces inside.
The things is this: The program needs to print a $ instead of a space , and then from the 2nd line it counts 5$ and then prints a double space.
I tried to do this, but I only managed to do something like this:
*
*$*
*$$$*
*$$$$$*
*$$$$$$$*
*$$$$$$$$$*
*$$$$$$$$$$*
I know that I should write a condition within the loop, but I don't know what to write.