Program to find the factorial of given number


#include<stdio.h>
main()
{
unsigned long int n,f;
printf("\nenter the number for which you want to find the factorial");
scanf("%d",&n);
f=fact(n);
printf("\nthe factorial of the number %d is %d",n,f);
}
fact(int n)
{
int k;
if(n==0)
return(1);
else
{
k=n*fact(n-1);
}
return(k);
}

Comments

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System

Lambda two tables and three tables inner join code samples