SHARE
TWEET

Untitled

a guest Oct 14th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int x=0;
  3. int fun(int n)
  4. {  
  5.     if(n>0)
  6.     {      
  7.         x++;        
  8.         return fun(n-1)+x;    
  9.     }    
  10.     return 0;
  11. }
  12.  
  13. int main()
  14. {   int r;    
  15.     r=fun(5);    
  16.     printf("%d\n",r);        
  17.     r=fun(5);    
  18.     printf("%d\n",r);        
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top