Write a program to find the factorial of the entered number

//this is a program to find the factorial of the entered number
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=1;
long int fact=1;

printf("\n\nENter any Number: ");
scanf("%d",&num);

while(i<=num)
{
fact=fact*i;
i++;
}

printf("\n\nThe Factorial of the Entered Number is  %ld.",fact);
getch();
}

Previous
Next Post »