C program to find a factorial of the entered number
/* C program to find a factorial of the entered
number. */
#include"stdio.h"
void
main()
{
int
i=1, k=1, num;
printf("Enter
the number: ");
scanf("%d",
&num);
while(i<=num)
{
k
= i*k;
i++;
}
printf("Factorial
of %d is: %d \n", num, k);
}
Output:
Comments
Post a Comment