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