Você está na página 1de 1

#include <stdio.

h>
#include <stdlib.h>
#include <string.h>

int FatRecursivo(int x){

    if(x == 0){

        return 1;

  }

    else{

        return x * FatRecursivo(x - 1);

  }

int main(void){

    int x;

    printf("Digite o valor de X: ");

    scanf("%d", &x);

    int resposta = FatRecursivo(x);

    printf("O valor do fatorial e: %d", resposta);

    return 0;
}

Você também pode gostar