This article is from solution of Let Us C by Yashwant Kanetkar. I also posted many another articles regarding solutions of Let Us C. If you have any problem regarding solution then give comment, I will surely reply your question.
Q. Write a program to find the factorial value of any number entered through the keyboard.
Ans.
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i, num, fact=1;
printf("enter a number ");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
fact=fact*i;
}
printf("\nFactorial Value Of The Number entered By User Is %d",fact);
getch();
}