#include<stdio.h>
int factorial(int n)
{
if(n<=1)
return 1;
else
return n*factorial(n-1);
}
main()
{
int a,b;
printf("\nEnter a number=");
scanf("%d",&a);
printf("\nfactorial %d is %d ",a,factorial(a));
}
int factorial(int n)
{
if(n<=1)
return 1;
else
return n*factorial(n-1);
}
main()
{
int a,b;
printf("\nEnter a number=");
scanf("%d",&a);
printf("\nfactorial %d is %d ",a,factorial(a));
}
No comments:
Post a Comment