// A C program to find factorial of a number
#include<stdio.h>#include<conio.h>
void main()
{
clrscr();
int n,fact=1,i=1;
printf("Enter an integer number: ");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
fact=fact*i;
}
printf("\nFactorial of %d is = %d",n,fact);
getch();
}
Output:
0 Comments