Advertisement
stsharin

Untitled

Mar 9th, 2020
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4. int fun (int n){
  5.  
  6. int r;
  7. if(n>=20){
  8. printf("n = %d\n", n);
  9. return n;
  10. }
  11.  
  12. else{
  13. r = n+fun(n*2);
  14. printf("%d\n",r);
  15. return r;
  16. }
  17.  
  18. }
  19. int main (){
  20. int c =fun(5);
  21. printf("c =%d",c);
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement