Hello I'm new to C++. This is my second time writing a program.
I'm supposed to write this code where if i input an even number, a loop based triangle shows up and if i input an odd number, a different loop based triangle shows up. I got some help from a website and modified it for my needs and it works perfectly. The only problem is that I don't understand how it works.
Basically, the inner for loop is printing out the "*" while the outside loop allows the program to go to the next line for the inner loop to redo the process.
Think of the outer loop being the row you are editing. As you get into a row, the inner loop will do something with that row (in this case print out a number of "*"). Once the inner loop is finished, the outer loop would then go to the next row and keep doing this until the outer loop is completed.