Advertisement
apl-mhd

RecursionIsPera

Sep 21st, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. void myFunction( int counter)
  6. {
  7. if(counter == 2)
  8.      return;
  9. else
  10.        {
  11.        //cout <<counter<<endl;
  12.                      //printf(" %d ", counter);
  13.  
  14.        myFunction(--counter);
  15.               printf(" %d ", counter);
  16.  
  17.        return;
  18.        }
  19. }
  20.  
  21. int main(){
  22.         myFunction(5);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement