Sunday, March 21, 2021

 #include <stdio.h>

long int factorial(int number//function definition
{
    if (number == 1 || number == 0//base condition
    {
        return 1;
    }
    else
    {
        return (number * factorial(number - 1)); //function recalling
    }
}
int main()
{
    long int num;
    printf("enter the number you want factorial of : \n");
    scanf("%d", &num);
    printf("the factorial of %ld is %ld"numfactorial(num)); //function call
    return 0;
}

No comments:

Software scope

 In software engineering, the software scope refers to the boundaries and limitations of a software project. It defines what the software wi...

Popular Posts