C Program To Find Factorial Using Function
#include<stdio.h>
long int fact(int);
int main()
{
int n;
printf("Enter number");
scanf("%d",&n);
printf("%d!=%ld\n",n,fact(n));
}
long int fact(int n)
{
if(n<=1)
return 1;
else
return (n*fact(n-1));
}
OUTPUT
Post A Comment:
0 comments so far,add yours