Advertisement
apl-mhd

RecursionQuestion

Oct 8th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.     void countFun(int count){
  6.  
  7.         if(count > 20){
  8.  
  9.  
  10.        return;
  11.  
  12.     }
  13.  
  14.     else{
  15.  
  16.          printf(" %d ", count);
  17.  
  18.         countFun(count + 1);
  19.     }
  20.  
  21.     return;
  22.  
  23.     printf(" 0 ");
  24.    // printf(" %d ", count);
  25.  
  26.     }
  27.  
  28. int main()
  29. {
  30.  
  31.     countFun(1);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement