Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. void fact(int n,int *p)
  4. {
  5. if(n==0 && (*p)==1)
  6. (*p)=1;
  7. if(n>=1)
  8. {
  9. fact(n-1,(*p)*n);
  10. }
  11. }
  12. int main()
  13. {
  14. int x=1;
  15. fact(6,&x);
  16. printf("%d",x);
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement