Write a recursive function that takes as a parameter a nonnegative integer and g
ID: 3630547 • Letter: W
Question
Write a recursive function that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern generated is:****
***
**
*
*
**
***
****
Also, write a program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern. For example, specifying 4 as thse number of lines generates the above pattern
2.Write a recursive function that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern is generated is:
*
**
***
****
****
***
**
*
Also,write a program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern.
Explanation / Answer
#include #include void display1(int a) { int d; static int c=1; if (c>0) for(d=0;dRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.