#include <stdio.h>
long int fact(int);
int main(void)
{
int n;
long int f;
printf("\nEnter a number : ");
scanf("%d", &n);
f = fact(n);
printf("\nFactorial of %d is %ld", n, f);
return 0;
}
long int fact(int num)
{
long int res = 1;
if(num == 1)
return res;
res = num * fact(num - 1);
return res;
}
long int fact(int);
int main(void)
{
int n;
long int f;
printf("\nEnter a number : ");
scanf("%d", &n);
f = fact(n);
printf("\nFactorial of %d is %ld", n, f);
return 0;
}
long int fact(int num)
{
long int res = 1;
if(num == 1)
return res;
res = num * fact(num - 1);
return res;
}
No comments:
Post a Comment
kiss on google ads if you are anonymous because your ip is trackable.thank you.
......from.admin