C++ pattern programs
1
222
33333
4444444
33333
222
1
*
***
*****
*******
*****
***
*
*****
***
*
*
***
*****
*******
Recursion: a function that calls itself.
Recursion in computer science is a method where the solution to a
problem depends on solutions to smaller instances of the same problem. Most computer programming languages
support recursion by allowing a function to call itself within the program
text. Some functional
programming languages do not
define any looping constructs but rely solely on recursion to repeatedly call
code.
USE: we
can use recursion for iteration
Comments