Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void main(){
- int valor;
- printf("Insira um numero para obter seu fatorial:\n");
- scanf("%d", &valor);
- printf("\n\nO fatorial de %d e: %d\n", valor, Fatorial(valor));
- system("pause");
- }
- int Fatorial(int n){
- if(n == 1)
- return 1;
- else
- return n * Fatorial (n-1);
- }
Advertisement
Add Comment
Please, Sign In to add comment