Wednesday, October 6, 2010

C Program to find factorial of a number

int main()
{
int n,i,f=1;
printf("enter any num \n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
f=f*i;
}
printf("factorial is %d ",f);
system("pause");
}

No comments:

Post a Comment