The problem I can see with doing it this way is that it uses iteration instead of recursion - I don't know how to implement the for loop inside a recursive function.
I have tried implementing the loop one way and got a warning:
warning: multi-character character constant
and it printed:
Problem printing pyramid of asterisks recursively in UNIX system
Hi. I am trying to print a pyramid of asterisks using recursion so that the recursive function takes in an integer and prints that number of lines of asterisks and then reverses, eg:
Leave a comment: