Find factorial of a given number

Factorial Number in C Programming

#include
#include

void main()
{
int n,i,fact=1;
clrscr();
printf(“Enter any no: “);
scanf(“%d”,&n);
for(i=n;i>=1;i–)
{
fact=fact*i;
}
printf(“Factorial=%d”,fact);
getch();
}

Comments

comments

Leave a Reply

Your email address will not be published. Required fields are marked *