Wednesday, December 4, 2013

TO FIND FACTORIAL OF A NUMBER IN C

//TO FIND FACTORIAL OF A NUMBER IN C
# include<stdio.h>
int main()
{
int fac,n;
int factorial(int);
printf("Enter any number:");
scanf("%d",&n);
fac=factorial(n);
printf("Factorial=%d",fac);
return 0;
}

int factorial(int x)
{
int f;
if(x==1)
return 1;
else
f=x*factorial(x-1);
return f;
}

1 comment:

  1. Betway Casino site | Lucky Club
    Check out the site's odds, features, reviews luckyclub and bet types for Betway. If you like Betway then you can sign up for an account and place bets on your favourite sports.

    ReplyDelete