Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int x=0;
- int fun(int n)
- {
- if(n>0)
- {
- x++;
- return fun(n-1)+x;
- }
- return 0;
- }
- int main()
- { int r;
- r=fun(5);
- printf("%d\n",r);
- r=fun(5);
- printf("%d\n",r);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement