Program description:

This is a program to find out the factorial of a number entered by the user. After showing the value of the factorial we will ask the user whether he wants to find factorial of another number or not.

Source Code:

#include<stdio.h>
int main()
{
int a=1,i,n,fact;
do
{
fact=1;
printf("Enter a number to find the factorial:");
scanf("%d",&n);
for(i=1;i<=n;i++)
fact=fact*i;
printf("The factorial of %d is %d\n",n,fact);
printf("Do you want to check another number?(0/1):");
scanf("%d",&a);
if(a==0)
break;
}while(a==1);
printf("Thank You");
}

Output:

If you have any queries or doubts feel free to comment down below!!