PROGRAM TO FIND A FACTORIAL IN C


Hello Friends !!! Now I am tell about the c program that how to find a factorial by using c program given below...
#include
#include
void main()
{
int n,i,fact=1;
clrscr();
printf("enter a number");
scanf("%d",&n);
for(i=1;i<=5;i++)
{
fact=fact*i;
}
printf("%d",fact);
getch();
}

I think this post will help you.
Thanks !!!!
If any query about this post then post your comment below..I will help you 100% surely..

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites