Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. //OUTPUT SHOULD BE nothing ,but it print
  2.  
  3. //0, 1, 2, 0,
  4. //I would like to know why
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. #include<stdio.h>
  14. void fun(int);
  15. typedef int (*pf) (int, int);
  16. int proc(pf, int, int);
  17.  
  18. int main()
  19. {
  20. int a=3;
  21. fun(a);
  22. return 0;
  23. }
  24. void fun(int n)
  25. {
  26. if(n > 0)
  27. {
  28. fun(--n);
  29. printf("%d,", n);
  30. fun(--n);
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement