apl-mhd

Double Recursion

Jan 29th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4.  
  5. void display(int n){
  6.    
  7.         printf(" %d ",n);
  8.        
  9.         if(n==0){
  10.         // n=3;
  11.          printf("\n");
  12.          return;
  13.      }
  14.          
  15.     display(n-1);
  16.     display(n-1);
  17.        
  18.            
  19.        
  20.        
  21.    
  22.    
  23.     }
  24.  
  25.  
  26. int main(int argc, char **argv)
  27. {
  28.     display(3);
  29.    
  30.     return 0;
  31. }
Add Comment
Please, Sign In to add comment