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