Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int factorial (int n) {
- if(n < 2) return 1;
- return n * factorial(n-1);
- }
- void main() {
- int n;
- printf("Digite o valor de N: ");
- scanf("%d", &n);
- printf("%d! = %d\n", n, factorial(n));
- }
Advertisement
Add Comment
Please, Sign In to add comment