Write a program to find the factorial value of any number entered through the keyboard.
void main()
{
float d,t;
t=1;
printf("\nEnter a number to find its factorial");
scanf("%f",&d);
while(d>0)
{
t*=d;
d--;
}
printf("\nThe factorial of the number is %f",t);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment