C++ program to show pattern

 program to show following pattern:-
C++ program using recursion to print following pattern

     *     
    ***    
   *****  
  ******* 
Program:-              
Output:-
   Enter an odd number  :  7
   *     
  ***    
 *****  
******* 
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