Answers for "find factorial of a number in c using recursion with function which entered by user"

C
3

find factoril in C using recursion

#include<stdio.h>
fact(int i, int k){
    k=k*i;
    i--;
    if(i==0){
        return k;
    }
    else{
        fact(i, k);
    }
}
int main()
{
    int k = 1, i, factorial;
    scanf("%d",&i);
    factorial = fact(i, k);
    printf("%d\n",factorial);
    return 0;
}
Posted by: Guest on January-31-2021

Code answers related to "find factorial of a number in c using recursion with function which entered by user"

Code answers related to "C"

Browse Popular Code Answers by Language