Factorial Value of any number

Write a program to find the factorial value of any number entered through the keyboard.
#include
#include
void main(void)
{
clrscr();
long a,d,e=1;
printf("Enter any number:");
scanf("%ld",&a);
for(d=1;d<=a;d++)
{
e=e*d;
}
printf("%ld",e);

getch();
}
 

Comments

Popular posts from this blog

Tip of the Day # 13

Governor Generals of Pakistan