I need to to write a method that is called like printTriangle(5);. We need to create an iterative method and a recursive method (without ANY iteration). The out
printTriangle(5);
You can do it like this:
The method gets the number of stars as a parameter. Let's call it n.
Then it:
calls itself recursively with n-1.
prints a line with n stars.
Make sure to do nothing if n == 0.