I need help to write a recursive function to generate the following pattern of stars:
*
* *
* * *
* * * *
* * *
* *
*
I also need write a program to test the recursive function and promts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern when the user presses enter. For example, the middle line of stars in the pattern above has 4 stars in it. If the user were to enter 5 into the program, then the program would display the following:
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
If you'll notice, the line in the middle now has 5 stars instead of 4.
i would greatly appreciate any help.



LinkBack URL
About LinkBacks


