logo CodeStepByStep logo

PrintStars

Language/Type: C# recursion
Related Links:

Write a recursive method named PrintStars that accepts an integer parameter n and prints n occurrences of the "*" character to the console. For example, the call of PrintStars(5); should print ***** . Do not use loops or auxiliary data structures; solve the problem recursively. You may assume that the value passed is non-negative.

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.