fork download
  1. #include<stdio.h>
  2. int call(int);
  3. int main()
  4. {
  5. int n=4;
  6. //printf("1 function");
  7. call(n);
  8. getchar();
  9. return 0;
  10. }
  11. int call(int n)
  12. {
  13. if(n<=0)//this is the base condition so that we can terminate the recursion!!!
  14. return 0;
  15. else
  16. call(--n);//function calling itself...i.e. recursion!!!
  17. printf("\n%d function",n);
  18. call(--n);//function calling itself...i.e. recursion!!!
  19. return 0;
  20. }
Success #stdin #stdout 0s 2856KB
stdin
Standard input is empty
stdout
0 function
1 function
2 function
0 function
3 function
0 function
1 function