Factorial Iterativo

#include<stdio.h>

int main(){
    int i,x,fac=1;
   
    printf("Factorial de: "); scanf("%d",&x);

    if(x>0){
        for(i=1;i<=x;i++){
            fac = fac * i;                  
        }
        printf("FACTORIAL de %d = %d",x,fac);
    }
    else
    {
        if(x == 0) printf("FACTORIAL de 0 = 1");
        else
        {
            printf("FACTORIAL DE NUMERO NEGATIVO NO EXISTE");
        }
    }
getchar();getchar();
return 0;
}

1 comentario:

Anónimo dijo...

Bitcoin Casino - Slots, Live Dealers & more! - Casinoworld
If you have an account with the Bitcoin Casino and want 인카지노 to 제왕카지노 play at a casino that's in your jurisdiction, it's important to go to septcasino the appropriate