Write Function Called Printstars Function Receives Parameter Containing Integer Value Para Q37019584

Write a function called printStars. The function receives aparameter containing an integer value. If the parameter ispositive, the funciton prints (to standard output) the given numberof asterisks. Otherwise the function does nothing. The functiondoes not return a value. Thus, if printStars(8) is called, ********(8 asterisks) will be printed. The function must not use a loop ofany kind (for, while, do-while) to accomplish its job. Instead, itshould examine its parameter, returning if the parameters value isnot positive. If the parameter is positive, it:

  • prints a single asterisk (and no other characters)
  • then crecursively calls itself to print the remainingasterisks

This is what I got,

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.